* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "HarmonyOS Sans", "Microsoft YaHei", sans-serif;
}
.history-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.history-actions button {
    padding: 4px 10px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.restore-btn {
    background-color: #e8f5e9;
    color: #2e7d32;
}
.restore-btn:hover {
    background-color: #c8e6c9;
}

.delete-permanent-btn {
    background-color: #ffebee;
    color: #b71c1c;
}
.delete-permanent-btn:hover {
    background-color: #ffcdd2;
}
        :root {
            --primary: #6a9ec2;
            --danger: #ff6b6b;
            --success: #88d498;
            --warning: #f7c948;
            --bg: #ccf0d5;
            --card: #ffffff;
            --text: #333;
            --border: #e0e6ed;
            --completed: #d5e8d4;
            --abandoned: #f8cecc;
        }

        body {
            background: linear-gradient(135deg, #6faaff, #6fd26f);;
            color: var(--text);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .container {
            width: 100%;
            max-width: 800px;
            background: var(--card);
            border-radius: 16px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            overflow: hidden;
        }

        /* 登录页 */
        .login-page {
            padding: 40px;
            text-align: center;
        }

        .login-page h1 {
            margin-bottom: 30px;
            color: var(--primary);
            font-size: 28px;
        }

        .input-group {
            margin-bottom: 20px;
            text-align: left;
        }

        .input-group label {
            display: block;
            margin-bottom: 6px;
            font-weight: 500;
            color: #555;
        }

        .input-group input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 16px;
            transition: border 0.3s;
        }

        .input-group input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .btn {
            width: 100%;
            padding: 12px;
            background: var(--primary);
            color: rgb(255, 255, 255);
            border: none;
            border-radius: 8px;
            font-size: 16px;
            cursor: pointer;
            transition: background 0.3s;
        }

        .btn:hover {
            background: #5a8dbf;
        }

        /* 主界面 */
        .main-app {
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        .header {
            padding: 20px 24px;
            background: var(--primary);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
        }

        .current-time {
            font-size: 20px;
            font-weight: bold;
            text-align: center;
        }

        .header-buttons {
            display: flex;
            gap: 8px;
        }

        .logout-btn,
        .clear-btn {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            padding: 6px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
        }

        .content {
            padding: 24px;
            flex: 1;
            overflow-y: auto;
        }

        .section-title {
            font-size: 18px;
            margin: 16px 0 12px;
            color: #444;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .toggle-history {
            font-size: 14px;
            color: var(--primary);
            background: none;
            border: none;
            cursor: pointer;
            text-decoration: underline;
        }

        .add-task-form {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 8px;
            margin-bottom: 20px;
        }

        @media (min-width: 601px) {
            .add-task-form {
                grid-template-columns: 1fr 140px 100px auto;
            }
        }

        .add-task-form input,
        .add-task-form select {
            padding: 10px 14px;
            border: 1px solid var(--border);
            border-radius: 6px;
            font-size: 15px;
        }

        .add-task-form button {
            padding: 10px 16px;
            background: var(--primary);
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            grid-column: span 1;
        }

        .task-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .task-item {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            padding: 14px;
            border-radius: 10px;
            background: #f9fbfd;
            border-left: 4px solid var(--primary);
            position: relative;
            transition: border-color 0.3s;
        }

        .task-item.core {
            border-left-color: var(--danger);
            background: #fff5f5;
        }

        .task-actions {
            display: flex;
            gap: 8px;
            flex-shrink: 0;
        }

        .task-actions button {
            padding: 4px 8px;
            font-size: 12px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }

        .move-btn {
            background: #e0e9f1;
            color: var(--primary);
        }

        .complete-btn {
            background: #d5e8d4;
            color: #2e7d32;
        }

        .abandon-btn {
            background: #f8cecc;
            color: #b71c1c;
        }

        .delete-btn {
            background: #ffebeb;
            color: var(--danger);
        }

        .task-text {
            flex: 1;
            word-break: break-word;
            padding-right: 10px;
            line-height: 1.4;
        }

        .task-ddl {
            font-size: 13px;
            color: #777;
            margin-top: 4px;
        }

        /* 历史记录 */
        #historySection {
            display: none;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px dashed var(--border);
        }

        .history-item {
            padding: 12px;
            background: #fafafa;
            border-radius: 8px;
            margin-bottom: 8px;
            font-size: 14px;
            border-left: 4px solid var(--primary);
        }

        .history-item.completed {
            border-left-color: #2e7d32;
            background: var(--completed);
        }

        .history-item.abandoned {
            border-left-color: #b71c1c;
            background: var(--abandoned);
        }

        .history-meta {
            font-size: 12px;
            color: #777;
            margin-top: 4px;
        }

        .history-status {
            font-weight: bold;
            margin-right: 8px;
        }

        @media (max-width: 600px) {
            .login-page { padding: 30px 20px; }
            .header {
                flex-direction: column;
                gap: 10px;
            }
            .add-task-form {
                grid-template-columns: 1fr;
            }
            .add-task-form > *:not(:last-child) {
                grid-column: span 1;
            }
            .current-time { font-size: 16px; }
        }

        /* 压力指数样式 */
#stressContainer {
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border-left: 5px solid #6a9ec2;
}

.stress-meter {
    font-family: 'Segoe UI', Arial, sans-serif;
}

.stress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stress-header h4 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.stress-value {
    font-size: 18px;
    font-weight: bold;
    color: #d32f2f;
    background: #ffebee;
    padding: 3px 10px;
    border-radius: 20px;
}

.stress-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.stress-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        #4caf50 0%, 
        #ffeb3b 30%, 
        #ff9800 60%, 
        #f44336 100%);
    transition: width 0.5s ease;
}

.stress-stats {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    font-size: 13px;
}

.high-stress { color: #f44336; }
.medium-stress { color: #ff9800; }
.low-stress { color: #4caf50; }

.stress-advice {
    font-size: 14px;
    color: #555;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #4caf50;
}

/* 紧急任务标记 */
.urgent-task {
    animation: pulse 2s infinite;
    border: 2px solid #f44336 !important;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(244, 67, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
}

/* ========== 新增：导航栏 & 首页样式 ========== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: white;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 12px;
}

.nav-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.2s;
    color: #555;
}

.nav-btn:hover {
    background: #f0f0f0;
}

.nav-btn.active {
    background: var(--primary);
    color: white;
}

/* 页面切换 */
.page-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px);}
    to { opacity: 1; transform: translateY(0);}
}

/* 首页卡片样式 */
.profile-card {
    max-width: 700px;
    margin: 40px auto;
    padding: 30px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.avatar {
    font-size: 80px;
    margin-bottom: 10px;
}

.profile-card h1 {
    margin: 10px 0 5px;
    color: #333;
}

.tagline {
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 24px;
}

.intro-text {
    text-align: left;
    line-height: 1.6;
    color: #444;
    margin: 24px 0;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 16px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
}

.social-links a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    border-bottom: 1px dashed;
}

/* ========== 调查问卷样式 ========== */
.survey-container {
    max-width: 700px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.survey-container h2 {
    text-align: center;
    color: var(--primary);
}

.survey-question {
    margin: 20px 0;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 12px;
}

.survey-question p {
    font-weight: 500;
    margin-bottom: 8px;
}

.survey-question label {
    margin-right: 20px;
    cursor: pointer;
}

#submitSurveyBtn, #resetSurveyBtn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    margin-right: 10px;
    transition: 0.2s;
}

#resetSurveyBtn {
    background: #ccc;
    color: #333;
}

#submitSurveyBtn:hover {
    background: #5a8dbf;
}

#resetSurveyBtn:hover {
    background: #bbb;
}

.survey-result {
    margin-top: 30px;
    padding: 15px;
    background: #e8f0fe;
    border-radius: 16px;
    text-align: center;
    font-weight: bold;
    display: none;
}

/* 首页功能按钮 */
.feature-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.feature-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}
.feature-btn:hover {
    background: #5a8dbf;
    transform: scale(1.02);
}

/* ========== 调查问卷 - 美化版 ========== */
.survey-container {
    max-width: 800px;
    margin: 30px auto;
    padding: 24px;
    background: linear-gradient(145deg, #ffffff 0%, #f8faff 100%);
    border-radius: 32px;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.survey-container h2 {
    text-align: center;
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.survey-container > p {
    text-align: center;
    color: #6c757d;
    margin-bottom: 32px;
    font-size: 0.95rem;
}

/* 单个问题卡片 */
.survey-question {
    background: white;
    margin: 24px 0;
    padding: 20px 20px 16px;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(106, 158, 194, 0.2);
}

.survey-question:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

/* 问题文字 */
.survey-question p {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 16px;
    color: #2c3e4e;
    padding-left: 4px;
    border-left: 4px solid var(--primary);
    padding-left: 12px;
}

/* 选项容器 - 自适应5个选项 */
.survey-question .options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

/* 每个选项的标签 */
.survey-question label {
    flex: 1;
    min-width: 70px;
    text-align: center;
    background: #f1f5f9;
    padding: 10px 8px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    color: #1e2a36;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* 自定义 radio 样式 */
.survey-question input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #adb5bd;
    border-radius: 50%;
    margin: 0;
    position: relative;
    cursor: pointer;
    transition: 0.1s;
}

.survey-question input[type="radio"]:checked {
    border-color: var(--primary);
    background-color: var(--primary);
    box-shadow: inset 0 0 0 4px white;
}

.survey-question label:hover {
    background: #e2e8f0;
    transform: scale(1.02);
}

/* 选中状态的标签高亮 */
.survey-question label:has(input:checked) {
    background: #e0f0fe;
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 500;
}

/* 按钮区域 */
#submitSurveyBtn, #resetSurveyBtn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 20px;
    margin-right: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#resetSurveyBtn {
    background: #e9ecef;
    color: #495057;
    box-shadow: none;
}

#submitSurveyBtn:hover {
    background: #5a8dbf;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(106,158,194,0.3);
}

#resetSurveyBtn:hover {
    background: #dee2e6;
    transform: translateY(-1px);
}

/* 结果卡片 */
.survey-result {
    margin-top: 32px;
    padding: 20px;
    border-radius: 28px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    display: none;
    backdrop-filter: blur(4px);
    animation: fadeSlideUp 0.4s ease;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 移动端适配 */
@media (max-width: 640px) {
    .survey-container {
        padding: 16px;
        margin: 16px;
    }
    .survey-question label {
        flex: 0 0 calc(33% - 8px);
        min-width: 70px;
        font-size: 0.8rem;
        padding: 8px 4px;
    }
    .survey-question .options-row {
        gap: 8px;
    }
}

/* 模态框背景遮罩 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 弹窗内容卡片 */
.modal-content {
    background-color: #fff;
    padding: 24px 28px;
    border-radius: 28px;
    width: 320px;
    max-width: 90%;
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    position: relative;
    animation: fadeSlideUp 0.2s ease;
}

/* 关闭按钮 */
.modal-content .close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
}
.modal-content .close:hover {
    color: #333;
}

/* 弹窗标题 */
.modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 1.5rem;
}

/* 弹窗输入框 */
.modal-content input {
    width: 100%;
    padding: 12px 14px;
    margin: 8px 0;
    border: 1px solid #ddd;
    border-radius: 40px;
    font-size: 1rem;
    transition: border 0.2s;
}
.modal-content input:focus {
    outline: none;
    border-color: var(--primary);
}

/* 弹窗提交按钮 */
.modal-content button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    margin-top: 12px;
    transition: background 0.2s;
}
.modal-content button:hover {
    background: #5a8dbf;
}

/* 错误信息 */
#modalError {
    margin-top: 12px;
    font-size: 0.85rem;
}

/* 简单动画 */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.close {
    float: right;
    cursor: pointer;
}
.auth-btn {
    background: none;
    border: 1px solid white;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 8px;
}
.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-btn {
    background: rgba(255, 255, 255, 0.2);  /* 半透明白色背景 */
    border: 1px solid var(--primary);      /* 使用主题色边框 */
    color: var(--primary);                 /* 文字使用主题色 */
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 8px;
    transition: 0.2s;
}
.auth-btn:hover {
    background: var(--primary);
    color: white;
}