/* ==================== Modern Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Color Palette */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);

    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #00d4aa;
    --danger-color: #ff6b9d;
    --warning-color: #ffc107;

    --bg-primary: #f8f9fe;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);

    --text-primary: #1a202c;
    --text-secondary: #718096;
    --text-muted: #a0aec0;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.16);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-secondary);
    min-height: 100vh;
    box-shadow: var(--shadow-xl);
}

/* ==================== Header ==================== */
.header {
    background: var(--primary-gradient);
    color: white;
    padding: 2rem 2rem 1.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Cpath d='M30 0L0 30l30 30 30-30z' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.1;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.header h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#username-display {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 500;
}

.logout-btn {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.tab-btn {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
    color: white;
    padding: 0.75rem 1.75rem;
    cursor: pointer;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    border-color: white;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

/* ==================== Views ==================== */
.view {
    display: none;
    padding: 2.5rem;
    animation: fadeIn 0.4s ease-in-out;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Date Header ==================== */
.date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    color: white;
    box-shadow: var(--shadow-md);
}

.date-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.quick-stats {
    font-size: 1.5rem;
    font-weight: 700;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

/* ==================== Time Blocks ==================== */
.time-block {
    margin-bottom: 3rem;
}

.time-block h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.time-block h3::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: var(--primary-gradient);
    border-radius: 4px;
}

.period-info {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 0.5rem;
}

/* ==================== Task List ==================== */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    border-left: 4px solid var(--text-muted);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.task-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.task-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.task-item:hover::before {
    transform: scaleY(1);
}

.task-item.required {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.05) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.task-item.completed {
    border-left-color: var(--success-color);
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.05) 0%, rgba(255, 255, 255, 0.9) 100%);
    opacity: 0.85;
}

.task-item.completed .task-name {
    text-decoration: line-through;
    opacity: 0.7;
}

.task-info {
    flex: 1;
}

.task-name {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.task-item.required .task-name::after {
    content: "必做";
    margin-left: 0.75rem;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--danger-color);
    color: white;
    border-radius: 4px;
    font-weight: 600;
}

.task-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.task-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.task-note-display {
    font-size: 0.9rem;
    color: var(--success-color);
    font-style: italic;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 212, 170, 0.1);
    border-radius: var(--radius-sm);
}

/* ==================== Buttons ==================== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #00d4aa 0%, #00a896 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff4d6d 100%);
    color: white;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

/* ==================== Today Theme ==================== */
.today-theme {
    --theme-color: #6366f1;
    background: linear-gradient(135deg, var(--theme-color), color-mix(in srgb, var(--theme-color) 70%, #764ba2));
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.today-theme::before {
    content: '';
    position: absolute;
    right: -2rem;
    top: -2rem;
    width: 8rem;
    height: 8rem;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.theme-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.theme-header #theme-icon {
    font-size: 1.5rem;
}

.theme-header #theme-name {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.9;
}

.theme-sub {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.theme-header {
    justify-content: flex-start;
}

.theme-edit-btn {
    margin-left: auto;
    color: white !important;
    opacity: 0.8;
}

.theme-edit-btn:hover {
    opacity: 1;
}

.no-theme {
    padding: 1rem;
    text-align: center;
    margin-bottom: 1rem;
}

/* ==================== Edit Mode ==================== */
.edit-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.edit-mode-toggle:hover {
    background: rgba(0,0,0,0.05);
}

.edit-mode-toggle input {
    cursor: pointer;
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 编辑模式下的元素默认隐藏 */
.edit-mode-only {
    display: none !important;
}

/* 编辑模式激活时显示 */
body.edit-mode .edit-mode-only {
    display: flex !important;
}

body.edit-mode .edit-mode-only.btn {
    display: inline-flex !important;
}

/* ==================== Theme Modal ==================== */
.modal-large {
    max-width: 600px;
}

.theme-plan-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.theme-plan-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid var(--theme-color, #6366f1);
}

.theme-plan-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.theme-plan-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.theme-plan-info {
    flex: 1;
}

.theme-plan-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.theme-plan-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Form sections */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-row {
    display: flex;
    gap: 0.75rem;
}

.flex-1 {
    flex: 1;
}

/* Collapsible section */
.collapsible .collapsible-content {
    display: none;
}

.collapsible.expanded .collapsible-content {
    display: block;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
}

.collapsible-header:hover {
    color: var(--primary);
}

.collapse-icon {
    font-size: 0.7rem;
    margin-left: 0.5rem;
    transition: transform 0.2s;
}

.collapsible.expanded .collapse-icon {
    transform: rotate(90deg);
}

/* ==================== Schedule Config ==================== */
.weekday-config {
    display: grid;
    gap: 0.5rem;
}

.weekday-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weekday-label {
    width: 3rem;
    font-size: 0.9rem;
}

.weekday-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

/* ==================== Algo Theme (Legacy) ==================== */
.algo-theme {
    background: var(--primary-gradient);
    color: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-top: 3rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.algo-theme::before {
    content: '💡';
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4rem;
    opacity: 0.2;
}

.algo-theme h3 {
    margin-bottom: 0.75rem;
    color: white;
    font-weight: 700;
}

#algo-theme-display {
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ==================== Stats View ==================== */
#stats-view h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card.full-width {
    grid-column: 1 / -1;
}

.stat-card h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.25rem;
}

/* ==================== Chart Containers ==================== */
.chart-container {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.chart-container h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

/* ==================== Circular Progress ==================== */
.circular-progress-container {
    display: flex;
    justify-content: space-around;
    gap: 2rem;
    margin: 2rem 0;
}

.circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
}

.circular-progress svg {
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 10;
}

.circular-progress .progress-bg {
    stroke: rgba(0,0,0,0.05);
}

.circular-progress .progress-fill {
    stroke: url(#gradient);
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.circular-progress-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.circular-progress-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.circular-progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ==================== Heatmap Calendar ==================== */
.heatmap-container {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.heatmap-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20px, 1fr));
    gap: 4px;
    margin-top: 1rem;
}

.heatmap-day {
    aspect-ratio: 1;
    background: #e5e7eb;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.heatmap-day:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.heatmap-day[data-level="0"] { background: #ebedf0; }
.heatmap-day[data-level="1"] { background: #c6e48b; }
.heatmap-day[data-level="2"] { background: #7bc96f; }
.heatmap-day[data-level="3"] { background: #239a3b; }
.heatmap-day[data-level="4"] { background: #196127; }

/* ==================== Weak Points ==================== */
#weak-points {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.weak-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 255, 255, 0.5) 100%);
    border-left: 4px solid var(--warning-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.weak-item-progress {
    width: 60px;
    height: 6px;
    background: rgba(0,0,0,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-left: 1rem;
}

.weak-item-progress-fill {
    height: 100%;
    background: var(--warning-gradient);
    border-radius: 3px;
}

/* ==================== Recent History ==================== */
.history-section {
    margin-top: 3rem;
}

.history-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
}

#recent-history {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.history-day {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--text-muted);
    transition: all 0.3s ease;
}

.history-day:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.history-day.good {
    border-left-color: var(--success-color);
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.05) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.history-day.partial {
    border-left-color: var(--warning-color);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.history-day.poor {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.05) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.history-date {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.history-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==================== Settings View ==================== */
#settings-view h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-section {
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.settings-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.setting-item {
    margin-bottom: 1.5rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

.setting-item input[type="time"],
.setting-item input[type="checkbox"] {
    margin-right: 0.75rem;
}

.setting-item input[type="time"] {
    padding: 0.75rem;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.setting-item input[type="time"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.settings-section .btn {
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
}

/* ==================== Modal ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
}

.close:hover {
    color: var(--text-primary);
    background: rgba(0,0,0,0.1);
}

#modal-task-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.3s ease;
    resize: vertical;
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==================== Loading Animation ==================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .app {
        box-shadow: none;
    }

    .view {
        padding: 1.5rem;
    }

    .header {
        padding: 1.5rem 1rem;
    }

    .nav-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .date-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    #recent-history {
        grid-template-columns: 1fr;
    }

    .circular-progress-container {
        flex-direction: column;
        align-items: center;
    }
}

/* ==================== Utilities ==================== */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mt-1 {
    margin-top: 1rem;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--primary-color);
    color: white;
}

/* ==================== Version Management ==================== */
.version-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.version-item:hover {
    background: #f0f4ff;
}

.version-item.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.version-info {
    flex: 1;
}

.version-name {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.version-number {
    font-size: 0.8em;
    color: var(--text-secondary);
    font-weight: 500;
}

.version-badge {
    font-size: 0.7em;
    padding: 0.2em 0.5em;
    background: var(--primary-gradient);
    color: white;
    border-radius: 4px;
    font-weight: 500;
}

.version-meta {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.version-actions {
    margin-left: 1rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* ==================== Task Management ==================== */
#tasks-view h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.task-manage-section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.task-manage-section h3 {
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.task-manage-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.task-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-color);
}

.task-manage-item .task-info {
    flex: 1;
}

.task-manage-item .task-name {
    font-weight: 500;
    color: var(--text-primary);
}

.task-manage-item .task-duration {
    margin-left: 0.5rem;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.task-manage-item .task-required {
    margin-left: 0.5rem;
    font-size: 0.75em;
    padding: 0.2rem 0.4rem;
    background: var(--danger-color);
    color: white;
    border-radius: 3px;
}

.add-task-btn {
    margin-top: 0.5rem;
}

/* Task Edit Modal */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: var(--radius-md);
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-actions .btn {
    flex: 1;
}
