/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 主题变量 */
:root {
    /* 亮色主题 - 现代高级配色 */
    --bg-color: #f8fafc;
    --container-bg: #ffffff;
    --text-color: #1e293b;
    --header-color: #0f172a;
    --title-color: #3b82f6;
    --semester-color: #64748b;
    --border-color: #e2e8f0;
    --time-header-bg: #eff6ff;
    --time-header-color: #1e40af;
    --time-cell-bg: #f1f5f9;
    --subject-cell-bg: #ffffff;
    --subject-cell-hover: #f0f9ff;
    --morning-section-bg: #fefce8;
    --afternoon-section-bg: #f0f9ff;
    --break-time-bg: #fef2f2;
    --break-time-color: #dc2626;
    --notes-bg: #f8fafc;
    --notes-header-color: #0f172a;
    --notes-color: #475569;
    --shadow: 0 10px 25px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗色主题 - 现代高级配色 */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --container-bg: #1e293b;
    --text-color: #f1f5f9;
    --header-color: #f8fafc;
    --title-color: #60a5fa;
    --semester-color: #94a3b8;
    --border-color: #334155;
    --time-header-bg: #1e3a8a;
    --time-header-color: #dbeafe;
    --time-cell-bg: #1e293b;
    --subject-cell-bg: #0f172a;
    --subject-cell-hover: #1e3a8a;
    --morning-section-bg: #1e2a1a;
    --afternoon-section-bg: #1a2a3a;
    --break-time-bg: #2a1a1a;
    --break-time-color: #f87171;
    --notes-bg: #1e293b;
    --notes-header-color: #f8fafc;
    --notes-color: #cbd5e1;
    --shadow: 0 10px 25px rgba(0,0,0,0.3), 0 4px 10px rgba(0,0,0,0.2);
}

/* 基础样式 */
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
    color: var(--text-color);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    width: 100%;
    background-color: var(--container-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 20px;
    overflow-x: auto;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.combined-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--title-color);
    margin-bottom: 10px;
}

.school-name {
    font-size: 28px;
    font-weight: bold;
    color: var(--header-color);
    margin-bottom: 15px;
}

.title {
    font-size: 32px;
    font-weight: bold;
    color: var(--title-color);
    margin-bottom: 15px;
}

.semester {
    font-size: 18px;
    color: var(--semester-color);
    margin-bottom: 15px;
}

/* 主题切换按钮 */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, var(--title-color), #8b5cf6);
    border: none;
    border-radius: 50px;
    padding: 10px 18px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: white;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .theme-toggle {
    background: linear-gradient(135deg, var(--title-color), #8b5cf6);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .theme-toggle:hover {
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.4);
}

/* 动态更新按钮文本 */
[data-theme="dark"] .theme-toggle::before {
    content: "☀️ 亮色主题";
}

[data-theme="light"] .theme-toggle::before {
    content: "🌙 暗色主题";
}

/* 表格样式 */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
}

.schedule-table th,
.schedule-table td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: center;
    vertical-align: middle;
    transition: var(--transition);
}

.schedule-table th {
    background: linear-gradient(135deg, var(--title-color), #2563eb);
    color: white;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
    padding: 12px;
}

.time-header-time {
    background-color: var(--time-header-bg);
    color: var(--time-header-color);
    font-weight: bold;
    width: 70px;
    font-size: 14px;
}

.time-header-session {
    background-color: var(--time-header-bg);
    color: var(--time-header-color);
    font-weight: bold;
    width: 60px;
    font-size: 14px;
}

.time-time {
    background-color: var(--time-cell-bg);
    font-weight: bold;
    color: var(--time-header-color);
    width: 70px;
    font-size: 13px;
    padding: 10px 4px;
    text-align: center;
    border-right: 1px solid var(--border-color);
}

.time-session {
    background-color: var(--time-cell-bg);
    font-weight: bold;
    color: var(--time-header-color);
    width: 60px;
    font-size: 13px;
    padding: 10px 4px;
    text-align: center;
}

.time-time .time-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.time-time .time {
    font-size: 13px;
    font-weight: 600;
}

.time-session .session {
    font-size: 13px;
    color: var(--text-color);
    font-weight: 500;
}

.subject-cell {
    background-color: var(--subject-cell-bg);
    transition: var(--transition);
    width: 110px;
    min-width: 110px;
    position: relative;
}

.subject-cell:hover {
    background-color: var(--subject-cell-hover);
    transform: scale(1.02);
    z-index: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.subject-teacher {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-color);
}

.subject-name {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 4px;
}

.teacher-name {
    font-size: 13px;
    color: var(--semester-color);
}

.morning-section {
    background-color: var(--morning-section-bg);
}

.afternoon-section {
    background-color: var(--afternoon-section-bg);
}

.break-time {
    background-color: var(--break-time-bg);
    color: var(--break-time-color);
    font-weight: bold;
}

/* 备注样式 */
.notes {
    background: linear-gradient(135deg, var(--notes-bg), rgba(59, 130, 246, 0.05));
    border-radius: 12px;
    padding: 10px;
    margin-top: 10px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.notes h3 {
    color: var(--notes-header-color);
    margin-bottom: 8px;
    font-size: 16px;
}

.notes ul {
    list-style-position: inside;
    line-height: 1.4;
    margin: 0;
    padding: 0;
}

.notes li {
    margin-bottom: 4px;
    color: var(--notes-color);
    font-size: 14px;
}

/* 当天列突出显示 - 时间状态关闭时（无背景突出） */
.today-column {
    position: relative;
    z-index: 1;
}

/* 当天列突出显示 - 时间状态开启时（明显突出，无边框） */
.time-status-enabled .today-column {
    background-color: rgba(59, 130, 246, 0.15) !important;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.time-status-enabled [data-theme="dark"] .today-column {
    background-color: rgba(96, 165, 250, 0.2) !important;
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
}

/* 当前时间高亮效果 - 仅高亮当前时间单元格 */
.subject-cell.current-class {
    background-color: #60a5fa !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
    transform: scale(1.01);
    z-index: 2;
}

.subject-cell.current-class .subject-teacher {
    color: white !important;
    font-weight: bold;
}

/* 错误消息样式 */
.error-message {
    background-color: var(--break-time-bg) !important;
    color: var(--break-time-color) !important;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    font-weight: bold;
    border: 1px solid var(--break-time-color);
}

/* 配置图标样式 */
.header-top {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
}

.fullscreen-toggle {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-toggle:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

[data-theme="dark"] .fullscreen-toggle {
    background-color: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

[data-theme="dark"] .fullscreen-toggle:hover {
    background-color: #4b5563;
    border-color: #6b7280;
}

.config-toggle {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
    color: #6b7280;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.config-toggle:hover {
    background-color: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

[data-theme="dark"] .config-toggle {
    background-color: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

[data-theme="dark"] .config-toggle:hover {
    background-color: #4b5563;
    border-color: #6b7280;
}

/* 日期时间显示样式 - 左侧悬挂，无边框背景 */
.datetime-display {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
    color: var(--text-color);
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
    animation: slideInLeft 0.3s ease-out;
    z-index: 10;
    min-width: 140px;
    backdrop-filter: blur(10px);
}

.datetime-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    align-items: center;
}

.datetime-content .date,
.datetime-content .weekday,
.datetime-content .time {
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

.datetime-content .date {
    font-size: 13px;
}

.datetime-content .weekday {
    font-size: 13px;
    color: var(--title-color);
    font-weight: 600;
}

.datetime-content .time {
    font-size: 15px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: var(--title-color);
    cursor: pointer;
    transition: var(--transition);
}

.datetime-display:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 配置面板样式 */
.config-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 320px;
    max-width: 400px;
    animation: fadeInScale 0.3s ease-out;
}

.config-panel::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--title-color), #2563eb);
    color: white;
    border-radius: 12px 12px 0 0;
}

.config-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.config-content {
    padding: 20px;
}

.config-section {
    margin-bottom: 25px;
}

.config-section:last-child {
    margin-bottom: 0;
}

.config-section h4 {
    margin: 0 0 15px 0;
    color: var(--header-color);
    font-size: 16px;
    font-weight: bold;
}

/* 主题按钮样式 */
.theme-options {
    display: flex;
    gap: 10px;
}

.theme-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--container-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.theme-btn:hover {
    background-color: var(--subject-cell-hover);
    border-color: var(--title-color);
    transform: translateY(-1px);
}

.theme-btn.active {
    background: linear-gradient(135deg, var(--title-color), #2563eb);
    color: white;
    border-color: var(--title-color);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 开关样式 */
.toggle-container {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 34px;
    transition: var(--transition);
    margin-right: 12px;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--title-color), #2563eb);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-text {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

/* 响应式设计调整 */
@media screen and (max-width: 480px) {
    .config-panel {
        min-width: 280px;
        margin: 20px;
    }

    .datetime-content {
        flex-direction: column;
        gap: 8px;
    }

    .theme-options {
        flex-direction: column;
    }

    .config-toggle {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 8px;
    }

    .combined-title {
        font-size: 18px;
    }

    .school-name {
        font-size: 20px;
    }

    .title {
        font-size: 24px;
    }

    .semester {
        font-size: 18px;
    }

    .theme-toggle {
        font-size: 14px;
        padding: 6px 12px;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 8px;
        font-size: 12px;
    }

    .time-header-time,
    .time-time {
        width: 60px;
        font-size: 11px;
        padding: 8px 3px;
    }

    .time-header-session,
    .time-session {
        width: 50px;
        font-size: 11px;
        padding: 8px 3px;
    }

    .subject-cell {
        width: 85px;
        min-width: 85px;
    }

    .subject-teacher {
        font-size: 12px;
    }

    .subject-name {
        font-size: 13px;
    }

    .teacher-name {
        font-size: 11px;
    }

    .notes {
        padding: 8px;
    }

    .notes h3 {
        font-size: 14px;
    }

    .notes li {
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    body {
        padding: 5px;
    }

    .container {
        padding: 10px;
        border-radius: 6px;
    }

    .combined-title {
        font-size: 16px;
    }

    .school-name {
        font-size: 18px;
    }

    .title {
        font-size: 20px;
    }

    .semester {
        font-size: 16px;
    }

    .theme-toggle {
        font-size: 12px;
        padding: 5px 10px;
        position: relative;
        margin-bottom: 10px;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 6px;
        font-size: 11px;
    }

    .time-header-time,
    .time-time {
        width: 50px;
        font-size: 10px;
        padding: 6px 2px;
    }

    .time-header-session,
    .time-session {
        width: 40px;
        font-size: 10px;
        padding: 6px 2px;
    }

    .subject-cell {
        width: 70px;
        min-width: 70px;
    }

    .subject-teacher {
        font-size: 11px;
    }

    .subject-name {
        font-size: 12px;
    }

    .teacher-name {
        font-size: 10px;
    }

    .notes {
        padding: 6px;
    }

    .notes h3 {
        font-size: 12px;
    }

    .notes li {
        font-size: 11px;
    }
}

/* 大屏时钟样式 */
.big-clock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
    cursor: pointer;
    backdrop-filter: blur(3px);
}

.big-clock-container {
    background: transparent;
    text-align: center;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(1px);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.big-clock-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
}

.big-clock-date {
    font-size: 64px;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 3px;
}

.big-clock-weekday {
    font-size: 72px;
    font-weight: 800;
    color: var(--title-color);
}

.big-clock-time {
    font-size: 180px;
    font-weight: 900;
    font-family: 'Arial Black', 'Impact', 'Helvetica Neue', sans-serif;
    color: var(--text-color);
    letter-spacing: 8px;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.big-clock-close {
    position: absolute;
    top: 40px;
    right: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 36px;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.big-clock-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.2);
    opacity: 1;
    color: var(--title-color);
}

/* 大屏时钟暗色主题优化 */
[data-theme="dark"] .big-clock-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .big-clock-time {
    text-shadow: 0 2px 15px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .big-clock-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 明亮主题优化 */
[data-theme="light"] .big-clock-overlay {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
}

[data-theme="light"] .big-clock-container {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(1px);
}

[data-theme="light"] .big-clock-time {
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

/* 大屏时钟响应式设计 */
@media screen and (max-width: 768px) {
    .big-clock-header {
        gap: 20px;
        margin-bottom: 30px;
    }

    .big-clock-date {
        font-size: 48px;
    }

    .big-clock-weekday {
        font-size: 54px;
    }

    .big-clock-time {
        font-size: 120px;
        letter-spacing: 4px;
    }

    .big-clock-close {
        width: 50px;
        height: 50px;
        font-size: 30px;
        top: 30px;
        right: 30px;
    }
}

@media screen and (max-width: 480px) {
    .big-clock-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }

    .big-clock-date {
        font-size: 36px;
    }

    .big-clock-weekday {
        font-size: 42px;
    }

    .big-clock-time {
        font-size: 80px;
        letter-spacing: 2px;
    }

    .big-clock-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 20px;
        right: 20px;
    }
}

@media screen and (max-height: 600px) {
    .big-clock-header {
        margin-bottom: 20px;
    }

    .big-clock-date {
        font-size: 42px;
    }

    .big-clock-weekday {
        font-size: 48px;
    }

    .big-clock-time {
        font-size: 100px;
    }
}