/* ========================================
   1. 全局变量 / 页面基础 / 动画
======================================== */
:root {
    --yellow: #ffd54f;
    --yellow-soft: #fff8e1;
    --green: #66bb6a;
    --green-mid: #43a047;
    --blue: #42a5f5;
    --blue-deep: #1e88e5;
    --primary: #5cb85c;
    --primary-dark: #2e7d8e;
    --light: #f3faf9;
    --bg: #f0f7ff;
    --danger: #ff6b6b;
    --edit: #42a5f5;
    --today-bg: #fff9c4;
    --douyin: #161823;
    --bilibili: #fb7299;
    --xhs: #ff2442;
    --video: #8e44ad;
    --search-highlight: #ffe082;
    --gradient-brand: linear-gradient(128deg, #ffe082 0%, #81c784 48%, #64b5f6 100%);
    --gradient-brand-soft: linear-gradient(135deg, rgba(255, 224, 130, 0.35), rgba(129, 199, 132, 0.28), rgba(100, 181, 246, 0.32));
    --glass: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.85);
}

body {
    margin: 0;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Segoe UI', sans-serif;
    background:
        radial-gradient(ellipse 90% 70% at 8% 0%, rgba(255, 213, 79, 0.55), transparent 52%),
        radial-gradient(ellipse 75% 55% at 95% 8%, rgba(66, 165, 245, 0.42), transparent 50%),
        radial-gradient(ellipse 80% 60% at 42% 100%, rgba(129, 199, 132, 0.48), transparent 55%),
        linear-gradient(168deg, #fff9c4 0%, #e8f5e9 32%, #e3f2fd 68%, #bbdefb 100%);
    background-attachment: fixed;
    color: #2c3e50;
    min-height: 100vh;
    overflow-x: hidden;
}

@keyframes rotateDisc {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 全局交互手型 */
[onclick],
button,
.tab-btn,
.nav a,
.course-box,
#musicCtrl,
.icon-tag {
    cursor: pointer !important;
    user-select: none;
}


/* ========================================
   2. 通用工具栏 / 通用按钮 / 表单基础
======================================== */

/* 2.1 顶部工具栏 */
.toolbar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tool-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 50px;
    border: 2px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    transition: 0.3s;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(100, 181, 246, 0.18);
}

.card-week { border-color: var(--green-mid); }
.card-date { border-color: var(--edit); }
.card-search {
    border-color: #fbc02d;
    background: rgba(255, 253, 231, 0.8);
}

.tool-card select,
.tool-card input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-weight: bold;
    color: #444;
}

/* 2.2 通用按钮 */
button {
    border: none;
    transition: all 0.2s ease;
    outline: none;
}

.btn-ui-primary {
    background: var(--gradient-brand);
    color: #1a3a4a;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 6px 20px rgba(66, 165, 245, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-ui-secondary {
    background: var(--glass);
    color: #4a5f6a;
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    padding: 10px 24px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(100, 181, 246, 0.1);
}

.btn-ui-tag-edit {
    background: #e7f5ff;
    color: #228be6;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
}

.btn-ui-tag-del {
    background: #fff5f5;
    color: #fa5252;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
}

.btn-video-play {
    background: linear-gradient(45deg, #a4508b 0%, #5f0a87 74%);
    color: white;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-weight: bold;
    margin-top: 15px;
}

/* 增强交互反馈 */
.btn-ui-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(66, 165, 245, 0.35);
    filter: brightness(1.03);
}

.btn-ui-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

/* 输入聚焦样式 */
input:focus, textarea:focus, select:focus {
    border-color: rgba(66, 165, 245, 0.75);
    box-shadow: 0 6px 20px rgba(100, 181, 246, 0.15);
}

/* 全局更柔和的按钮与控件圆角 */
button, input, select, textarea {
    border-radius: 12px;
}

/* 顶部 header 视觉增强 */
.header {
    background: linear-gradient(90deg, rgba(255,255,255,0.88), rgba(255,248,225,0.82), rgba(227,242,253,0.88));
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav a {
    padding: 8px 12px;
    border-radius: 10px;
}

.nav a:hover {
    background: var(--gradient-brand-soft);
}

/* 占位符与细节 */
::placeholder { color: #9aaea0; opacity: 1; }

/* 微交互动效 */
.nav a {
    transition: background 0.18s, color 0.18s, transform 0.18s;
}

.nav a:active { transform: translateY(1px); }

/* 页面容器内卡片统一间距 */
.rank-card, .tool-card, .feedback-card {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.rank-card:hover, .feedback-card:hover { transform: translateY(-4px); }

/* 提交按钮在feedback区域更加醒目 */
#feedbackSubmitBtn {
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 700;
}

/* 使整体更柔和的字体显示 */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* 2.3 通用表单 */
input,
select,
textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid #eef2e6;
    border-radius: 12px;
    box-sizing: border-box;
    outline: none;
}


/* ========================================
   4. 主界面公共布局
======================================== */
.main-page {
    display: none;
}

.header {
    padding: 12px 30px;
    box-shadow: 0 8px 32px rgba(66, 165, 245, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav a {
    text-decoration: none;
    color: #666;
    margin: 0 15px;
    font-weight: bold;
    padding-bottom: 5px;
    border-bottom: 3px solid transparent;
}

.nav a.active {
    color: #1a5270;
    border-bottom-color: transparent;
    background: var(--gradient-brand-soft);
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(66, 165, 245, 0.15);
}

.container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 20px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 40px rgba(66, 165, 245, 0.1);
    border: 1px solid var(--glass-border);
}

.container > h3 {
    color: var(--primary-dark);
    font-size: 20px;
    margin: 0 0 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
}

th,
td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: var(--gradient-brand);
    color: #1a3a4a;
    font-weight: bold;
}

.is-today {
    background: var(--today-bg) !important;
    font-weight: bold;
}

.course-box {
    padding: 8px;
    border-radius: 8px;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    border: 1px solid transparent;
    transition: background 0.3s;
}

.course-box.highlight {
    background: var(--search-highlight) !important;
    border-color: #fbc02d;
    transform: scale(1.02);
}

.video-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--video);
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 4px;
}


/* ========================================
   12. 响应式适配
======================================== */

/* 12.1 平板及中等屏幕 */
@media (max-width: 900px) {
    .header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .toolbar {
        justify-content: flex-start;
    }
}

/* 12.2 手机端 */
@media (max-width: 600px) {
    body {
        font-size: 15px;
        -webkit-text-size-adjust: 100%;
    }

    .container {
        padding: 12px 10px;
    }

    .header {
        padding: 10px 12px;
        gap: 8px;
        align-items: stretch;
    }

    .header > div:first-child {
        font-size: 16px !important;
    }

    .nav {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0;
        width: 100%;
        padding-bottom: 4px;
        margin: 0 -4px;
        scrollbar-width: none;
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .nav a {
        flex: 0 0 auto;
        margin: 0 14px 0 0;
        padding: 8px 2px 10px;
        font-size: 14px;
        white-space: nowrap;
    }

    .header > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        width: 100%;
    }

    .header > div:last-child #userDisp {
        order: -1;
        flex: 1 1 100%;
        font-size: 12px;
        color: #555;
        line-height: 1.4;
        padding: 2px 0 4px;
    }

    .header > div:last-child button,
    .header > div:last-child .btn-ui-secondary {
        padding: 7px 10px !important;
        font-size: 12px !important;
        margin: 0 !important;
    }

    /* 工具条 */
    .toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 8px;
        margin-bottom: 12px;
        align-items: stretch;
    }

    .tool-card {
        width: 100%;
        box-sizing: border-box;
        padding: 6px 8px;
        min-height: 0;
        border-radius: 10px;
        border-width: 1px;
        font-size: 11px;
        gap: 4px;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }

    .tool-card span {
        font-size: 10px;
    }

    .tool-card select,
    .tool-card input[type="date"],
    .tool-card input[type="text"] {
        font-size: 11px !important;
        font-weight: 600;
        padding: 2px 0;
        flex: 1;
        min-width: 0;
    }

    .toolbar > .btn-ui-secondary {
        grid-column: span 1;
        width: 100%;
        padding: 7px 8px;
        font-size: 11px;
        box-sizing: border-box;
    }
}