﻿:root {
    --primary-color: #667eea;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2  100%);
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --shadow: 0 2px 12px rgba(0,0,0,0.04);
    --radius: 16px;
}

[data-theme="green"] {
    --primary-color: #10b981;
    --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
[data-theme="blue"] {
    --primary-color: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}
[data-theme="orange"] {
    --primary-color: #f59e0b;
    --primary-gradient: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}
[data-theme="pink"] {
    --primary-color: #F3ABB6;
    --primary-gradient: linear-gradient(135deg, #F3ABB6 0%, #9f8189 100%);
}
[data-theme="red"] {
    --primary-color: #ef4444;
    --primary-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}
[data-theme="night"] {
    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --bg-color: #1f2937;
    --card-bg: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --shadow: 0 2px 12px rgba(0,0,0,0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 80px;
    transition: background 0.3s ease, color 0.3s ease;
}

/* 加载动画 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-color);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.loading-overlay.active { display: flex; }

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0,0,0,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
[data-theme="night"] .loading-spinner {
    border-color: rgba(255,255,255,0.1);
    border-top-color: var(--primary-color);
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 头部 */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
[data-theme="night"] .header {
    background: rgba(55, 65, 81, 0.8);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.header-back {
    position: absolute;
    left: 16px;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 10;
}

/* 用户卡片 */
.user-card {
    margin: 16px;
    padding: 24px;
    background: var(--primary-gradient);
    border-radius: 20px;
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}
.user-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 200px; height: 200px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    pointer-events: none;
}

.greeting {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.user-time {
    font-size: 14px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* 功能服务区 */
.services-section { margin: 20px 16px; }
.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.services-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.service-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: inherit;
}
.service-item:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.service-item:active { transform: scale(0.98); }

.service-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 16px;
    position: relative;
    flex-shrink: 0;
}
.service-icon.green { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: #16a34a; }
.service-icon.blue { background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%); color: #4f46e5; }
.service-icon.cyan { background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%); color: #0891b2; }
.service-icon.pink { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); color: #ec4899; }

[data-theme="night"] .service-icon.green { background: rgba(22, 163, 74, 0.2); color: #4ade80; }
[data-theme="night"] .service-icon.blue { background: rgba(79, 70, 229, 0.2); color: #818cf8; }
[data-theme="night"] .service-icon.cyan { background: rgba(8, 145, 178, 0.2); color: #22d3ee; }
[data-theme="night"] .service-icon.pink { background: rgba(236, 72, 153, 0.2); color: #f9a8d4; }

.service-content { flex: 1; }
.service-name {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}
.service-desc {
    font-size: 13px;
    color: var(--text-secondary);
}
.service-arrow {
    color: var(--text-secondary);
    font-size: 20px;
    transition: all 0.2s;
    opacity: 0.5;
}
.service-item:hover .service-arrow {
    transform: translateX(4px);
    opacity: 1;
    color: var(--primary-color);
}

/* 帮助文档 */
.help-section {
    margin: 0 16px 24px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.help-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
}
.help-header:active { background: rgba(0,0,0,0.02); }

.help-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 16px;
}
[data-theme="night"] .help-icon {
    background: rgba(217, 119, 6, 0.2);
    color: #fcd34d;
}

.help-title { flex: 1; }
.help-title-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}
.help-title-desc {
    font-size: 13px;
    color: var(--text-secondary);
}
.help-toggle {
    color: var(--text-secondary);
    font-size: 20px;
    transition: transform 0.3s;
}
.help-section.expanded .help-toggle { transform: rotate(180deg); }

.help-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.help-section.expanded .help-content { max-height: 800px; }

.help-item {
    padding: 16px 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}
[data-theme="night"] .help-item { border-top: 1px solid rgba(255,255,255,0.05); }

.help-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.help-item-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.help-item-content p { margin-bottom: 8px; }

.help-notice {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 12px;
    color: #dc2626;
}
[data-theme="night"] .help-notice {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
    border-top: 1px solid rgba(0,0,0,0.05);
    z-index: 100;
}
[data-theme="night"] .bottom-nav { border-top: 1px solid rgba(255,255,255,0.05); }

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 24px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-secondary);
}
.nav-item.active { color: var(--primary-color); }
.nav-icon {
    font-size: 24px;
    transition: transform 0.2s;
}
.nav-item:active .nav-icon { transform: scale(0.9); }
.nav-text {
    font-size: 12px;
    font-weight: 500;
}

/* 页面切换 */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}
.page.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 个人中心 */
.profile-header {
    background: var(--primary-gradient);
    padding: 40px 24px;
    color: white;
    text-align: center;
}
.avatar-img {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: block;
    background: white;
}
.profile-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}
.profile-id {
    opacity: 0.8;
    font-size: 14px;
}

.menu-list {
    margin: 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.menu-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: rgba(0,0,0,0.02); }

[data-theme="night"] .menu-item,
[data-theme="night"] .about-menu-item {
    border-bottom-color: rgba(255,255,255,0.05);
}

.menu-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}
.menu-content { flex: 1; }
.menu-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}
.menu-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.menu-arrow {
    color: var(--text-secondary);
    font-size: 18px;
}

/* 二级通用页面 */
.hzy-common-page {
    padding: 16px;
    padding-bottom: 80px;
}
.common-main-btn {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--primary-gradient);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: white;
    text-decoration: none;
    margin-bottom: 20px;
}
.common-main-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-right: 16px;
}
.common-main-content { flex: 1; }
.common-main-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}
.common-main-desc {
    font-size: 14px;
    opacity: 0.9;
}

.common-section {
    margin-bottom: 24px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px 20px;
}
.common-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.common-icon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 8px;
}
.common-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}
.common-icon-item:active { transform: scale(0.92); }

.common-icon-circle {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.common-icon-circle.green { background: #dcfce7; color: #16a34a; }
.common-icon-circle.blue { background: #dbeafe; color: #2563eb; }
.common-icon-circle.purple { background: #ede9fe; color: #7c3aed; }
.common-icon-circle.cyan { background: #cffafe; color: #0891b2; }
.common-icon-circle.yellow { background: #fef3c7; color: #d97706; }
.common-icon-circle.orange { background: #ffedd5; color: #ea580c; }
.common-icon-circle.pink { background: #fce7f3; color: #ec4899; }
.common-icon-circle.gray { background: #f3f4f6; color: #6b7280; }

[data-theme="night"] .common-icon-circle.green { background: rgba(22, 163, 74, 0.2); color: #4ade80; }
[data-theme="night"] .common-icon-circle.blue { background: rgba(37, 99, 235, 0.2); color: #60a5fa; }
[data-theme="night"] .common-icon-circle.purple { background: rgba(124, 58, 237, 0.2); color: #a78bfa; }
[data-theme="night"] .common-icon-circle.cyan { background: rgba(8, 145, 178, 0.2); color: #22d3ee; }
[data-theme="night"] .common-icon-circle.yellow { background: rgba(217, 119, 6, 0.2); color: #fcd34d; }
[data-theme="night"] .common-icon-circle.orange { background: rgba(234, 88, 12, 0.2); color: #fb923c; }
[data-theme="night"] .common-icon-circle.pink { background: rgba(236, 72, 153, 0.2); color: #f9a8d4; }
[data-theme="night"] .common-icon-circle.gray { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }

.common-icon-text {
    font-size: 12px;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
}

/* 关于页面 */
.about-page {
    padding: 32px 20px;
    text-align: center;
}
.about-logo-img {
    width: 80px; height: 80px;
    border-radius: 20px;
    object-fit: cover;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: block;
}
.about-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.about-version {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.about-menu-list {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 40px;
}
.about-menu-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: background 0.2s;
}
.about-menu-item:last-child { border-bottom: none; }
.about-menu-item:active { background: rgba(0,0,0,0.02); }

.about-menu-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}
[data-theme="night"] .about-menu-icon { background: rgba(255,255,255,0.1); }

.about-menu-text {
    flex: 1;
    text-align: left;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.about-footer {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: center;
    opacity: 0.7;
}

/* 个性化设置 */
.settings-page-content {
    padding: 16px;
    padding-bottom: 80px;
}
.setting-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    margin-bottom: 24px;
}
.setting-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.theme-list-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border: 2px solid transparent;
}
.theme-list-item.active {
    border-color: var(--primary-color);
    background: rgba(0,0,0,0.02);
}
[data-theme="night"] .theme-list-item.active { background: rgba(255,255,255,0.05); }

.theme-list-preview {
    width: 40px; height: 40px;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.theme-list-preview.purple { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.theme-list-preview.green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.theme-list-preview.blue { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); }
.theme-list-preview.orange { background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%); }
.theme-list-preview.pink { background: linear-gradient(135deg, #F3ABB6 0%, #9f8189 100%); }
.theme-list-preview.red { background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%); }
.theme-list-preview.night { background: linear-gradient(135deg, #374151 0%, #111827 100%); }

.theme-list-info { flex: 1; }
.theme-list-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.theme-list-desc {
    font-size: 12px;
    color: var(--text-secondary);
}
.theme-list-check {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
    opacity: 0;
}
.theme-list-item.active .theme-list-check { opacity: 1; }

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 平板适配 */
@media (min-width: 768px) {
    .header, .profile-header, .hzy-common-page,
    .services-section, .help-section, .menu-list,
    .settings-page-content, .about-page {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
    .user-card {
        max-width: calc(600px - 32px);
        margin-left: auto;
        margin-right: auto;
    }
    .bottom-nav {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}
