:root {
    --bg: #FFFFFF;
    --page: #F5F5F7;
    --text: #1D1D1F;
    --text-secondary: #86868B;
    --border: #D2D2D7;
    --accent: #0071E3;
    --success: #34C759;
    --warning: #FF9500;
    --error: #FF3B30;
    --radius-btn: 10px;
    --radius-input: 10px;
    --radius-card: 16px;
    --radius-modal: 20px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-modal: 0 8px 30px rgba(0, 0, 0, 0.12);
    --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    font-family: var(--font-main);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-main {
    padding: 80px 0;
}

.page-main.slim {
    padding: 48px 0;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

/* 不支持 backdrop-filter 的浏览器降级 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .navbar {
        background: var(--bg);
    }
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* 汉堡菜单：桌面端隐藏 */
.nav-toggle-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nav-toggle-label {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: var(--text);
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar-logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-right: 32px;
}

.navbar-logo:hover {
    text-decoration: none;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.navbar-links a {
    color: var(--text);
    font-size: 15px;
    line-height: 56px;
    border-bottom: 2px solid transparent;
}

.navbar-links a:hover {
    text-decoration: none;
    color: var(--accent);
}

.navbar-links a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.page-body {
    padding-top: 56px;
    min-height: calc(100vh - 56px - 80px);
}

.footer {
    background: var(--page);
    color: var(--text-secondary);
    padding: 24px 0;
    font-size: 13px;
    line-height: 1.4;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.hero {
    background: var(--page);
    padding: 96px 0 80px;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 17px;
    line-height: 1.4;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
}

.section-title {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 24px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.card-grid .card {
    margin: -40px 0 0;
}

.feature-card {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

.feature-card .card-icon {
    margin-bottom: 16px;
}

.feature-card .card-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 8px;
}

.feature-card .card-desc {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    box-sizing: border-box;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 400;
    border-radius: var(--radius-btn);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    text-decoration: none;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn:hover {
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-md {
    padding: 0 20px;
    font-size: 15px;
}

.btn-lg {
    padding: 0 24px;
    font-size: 15px;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg);
}

.btn-primary:hover:not(:disabled) {
    background: #0077ED;
}

.btn-secondary {
    background: var(--bg);
    color: var(--accent);
    border-color: var(--accent);
}

.btn-secondary:hover:not(:disabled) {
    background: #F0F7FF;
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
}

.btn-ghost:hover:not(:disabled) {
    background: #F0F7FF;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--bg);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-secondary .spinner,
.btn-ghost .spinner {
    border-color: rgba(0, 113, 227, 0.3);
    border-top-color: var(--accent);
}

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

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.input,
.select,
.textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-main);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    padding: 0 12px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input,
.select {
    height: 44px;
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-tertiary, #AEAEB2);
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
    background: var(--page);
    cursor: not-allowed;
}

.textarea {
    min-height: 160px;
    padding: 12px;
    font-size: 14px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    line-height: 1.5;
    resize: vertical;
}

.select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2386868B' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.layout-split {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 24px;
    align-items: start;
}

.badge {
    display: inline-block;
    font-size: 13px;
    line-height: 1.4;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 400;
}

.badge-critical {
    background: #FFE5E3;
    color: #D70015;
}

.badge-warning {
    background: #FFF3E0;
    color: #B24D00;
}

.badge-info {
    background: #E3F0FF;
    color: #0057A8;
}

.badge-success {
    background: #E3F9E8;
    color: #1E7A34;
}

.result-panel {
    min-height: 320px;
}

.result-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.result-summary-text {
    font-size: 17px;
    font-weight: 600;
}

.issue-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.issue-card .card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.issue-card .card-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
}

.issue-card .card-desc {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 12px;
}

.issue-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.issue-suggestion {
    font-size: 14px;
    background: var(--page);
    border-radius: 8px;
    padding: 10px 14px;
    line-height: 1.5;
}

.issue-suggestion strong {
    font-weight: 600;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    gap: 12px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
}

.empty-state svg {
    color: var(--text-secondary);
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 320px;
    color: var(--text-secondary);
    font-size: 15px;
}

.loading-state .spinner {
    border-color: rgba(0, 113, 227, 0.3);
    border-top-color: var(--accent);
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    gap: 16px;
    text-align: center;
    color: var(--error);
    font-size: 15px;
}

.success-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    gap: 12px;
    text-align: center;
    color: var(--success);
    font-size: 17px;
    font-weight: 600;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.install-guide {
    margin-top: 24px;
}

.install-guide ol {
    margin: 12px 0 0 20px;
    font-size: 15px;
    line-height: 1.6;
}

.optimize-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 12px;
}

.shader-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.shader-card .shader-name {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

.shader-card .shader-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.shader-card .shader-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.shader-card .shader-link {
    font-size: 14px;
}

.score-dot {
    font-size: 13px;
    color: var(--warning);
}

.drag-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-card);
    padding: 32px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.drag-zone.dragover {
    border-color: var(--accent);
    background: #F0F7FF;
}

.login-form {
    max-width: 420px;
    margin: 80px auto;
}

.admin-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.stats-table th,
.stats-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.stats-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
}

.test-result {
    margin-top: 16px;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--page);
    line-height: 1.5;
}

.test-result.ok {
    color: var(--success);
}

.test-result.fail {
    color: var(--error);
}

.notice {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-24 {
    margin-bottom: 24px;
}

.hidden {
    display: none !important;
}

/* ==================== 响应式断点 ==================== */

/* 平板（<=1024px）：双栏调整 */
@media (max-width: 1024px) {
    .layout-split {
        grid-template-columns: 50% 50%;
    }
    .shader-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-title {
        font-size: 40px;
    }
}

/* 小平板/大手机（<=768px）：紧凑导航 + 单栏过渡 */
@media (max-width: 768px) {
    .container,
    .navbar-inner,
    .footer-inner,
    .card-grid {
        padding-left: 16px;
        padding-right: 16px;
    }
    .page-main {
        padding: 48px 0;
    }
    .hero {
        padding: 56px 0 40px;
    }
    .hero-title {
        font-size: 36px;
    }
    .layout-split {
        grid-template-columns: 1fr;
    }
    .card-grid,
    .shader-grid,
    .optimize-list,
    .admin-settings-grid {
        grid-template-columns: 1fr;
    }
    .navbar-links {
        gap: 16px;
    }
    .navbar-links a {
        font-size: 14px;
    }
    .navbar-register-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    /* 玻璃态降级为纯白 */
    .navbar {
        background: var(--bg);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* 手机（<=640px）：汉堡菜单 + 全单栏 + 触摸优化 */
@media (max-width: 640px) {
    .nav-toggle-label {
        display: flex;
    }
    /* 汉堡菜单展开时的 X 动画 */
    .nav-toggle-checkbox:checked ~ .nav-toggle-label .nav-toggle-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-toggle-checkbox:checked ~ .nav-toggle-label .nav-toggle-bar:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle-checkbox:checked ~ .nav-toggle-label .nav-toggle-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .navbar-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-hover);
        padding: 8px 16px 16px;
    }
    .nav-toggle-checkbox:checked ~ .navbar-links {
        display: flex;
    }
    .navbar-links a,
    .navbar-link {
        line-height: 48px;
        font-size: 15px;
        border-bottom: 1px solid var(--border);
    }
    .navbar-links a.active,
    .navbar-link.active {
        border-bottom-color: var(--accent);
    }
    .navbar-login-link {
        line-height: 48px;
        border-bottom: 1px solid var(--border);
    }
    .navbar-register-btn {
        margin: 12px 0;
        height: 44px;
        width: 100%;
        text-align: center;
    }
    /* 用户菜单在手机端直接展开 */
    .navbar-links .user-menu {
        width: 100%;
    }
    .navbar-links .user-menu-trigger {
        width: 100%;
        justify-content: space-between;
        border: 1px solid var(--border);
        border-radius: 0;
        padding: 0 12px;
        height: 48px;
    }
    .navbar-links .user-menu-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        padding: 0 0 8px;
        margin: 0;
        background: var(--page);
        border-radius: 0;
    }
    .navbar-links .user-menu-dropdown a,
    .navbar-links .user-menu-dropdown button {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    /* hero 标题进一步缩小 */
    .hero-title {
        font-size: 30px;
        line-height: 1.15;
    }
    .hero-subtitle {
        font-size: 15px;
    }
    .section-title {
        font-size: 24px;
    }

    /* 卡片圆角降至 12px（规范要求） */
    .card,
    .auth-card,
    .profile-info-card,
    .profile-form-card,
    .history-item {
        border-radius: 12px;
    }

    /* page-main 间距压缩 */
    .page-main {
        padding: 32px 0;
    }
    .page-main.slim {
        padding: 24px 0;
    }

    /* 表单全宽 */
    .auth-card {
        padding: 20px 16px;
    }

    /* history tabs 手机端横向滚动（768px 已处理尺寸） */
    .history-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
    }
    .history-tab {
        flex-shrink: 0;
    }

    /* 功能页表单紧凑 */
    .layout-split {
        gap: 16px;
    }
    .card {
        padding: 20px 16px;
    }

    /* recommend 表单单列（覆盖 inline grid） */
    .card > [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* 触摸友好 */
    .form-group label {
        font-size: 14px;
    }
    body,
    .btn,
    a,
    .navbar-link,
    .history-tab {
        -webkit-tap-highlight-color: transparent;
    }
}

/* 横屏手机：高度受限，下拉菜单限高滚动，hero 压缩 */
@media (max-width: 920px) and (orientation: landscape) and (max-height: 500px) {
    .navbar-links {
        max-height: calc(100vh - 56px);
        overflow-y: auto;
    }
    .textarea {
        min-height: 120px;
    }
    .hero {
        padding: 32px 0 24px;
    }
    .hero-title {
        font-size: 26px;
    }
    .page-main {
        padding: 24px 0;
    }
}

/* ==================== 账户系统 ==================== */

/* —— 导航栏：用户菜单 —— */
.navbar-login-link {
    color: var(--text);
    font-size: 15px;
    line-height: 56px;
    border-bottom: 2px solid transparent;
}

.navbar-login-link:hover {
    color: var(--accent);
    text-decoration: none;
}

.navbar-register-btn {
    line-height: 1;
    padding: 8px 16px;
    margin-left: 4px;
}

.user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    padding: 6px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    line-height: 1;
}

.user-menu-trigger:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.user-menu-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    box-shadow: var(--shadow-hover);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    z-index: 110;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
    background: var(--page);
    color: var(--accent);
    text-decoration: none;
}

.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown,
.user-menu-trigger[aria-expanded="true"] + .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* —— 账户页面通用 —— */
.auth-wrap {
    display: flex;
    justify-content: center;
    padding-top: 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    box-shadow: var(--shadow-card);
}

.auth-title {
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form .form-group {
    margin: 0;
}

.auth-submit {
    margin-top: 4px;
    width: 100%;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-links a {
    margin: 0 4px;
}

.auth-links-divider {
    color: var(--border);
}

.auth-state-error {
    text-align: center;
    color: var(--error);
    padding: 16px 0;
}

.auth-state-error svg {
    color: var(--error);
    margin-bottom: 8px;
}

.auth-state-error p {
    font-size: 15px;
    line-height: 1.5;
}

/* —— 表单提示 —— */
.form-alert {
    padding: 10px 14px;
    border-radius: var(--radius-btn);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.form-alert-error {
    background: rgba(255, 59, 48, 0.08);
    color: var(--error);
}

.form-alert-success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success);
}

.form-error {
    color: var(--error);
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
    display: none;
}

/* —— 个人中心 —— */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.profile-info-card,
.profile-form-card {
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.profile-section-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
}

.profile-info {
    margin: 0;
}

.profile-info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.profile-info-row:last-child {
    border-bottom: 0;
}

.profile-info-row dt {
    width: 80px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.profile-info-row dd {
    margin: 0;
    color: var(--text);
    word-break: break-all;
}

.profile-info-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-form .form-group {
    margin: 0;
}

.profile-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* —— 历史记录 —— */
.history-header {
    margin-bottom: 24px;
}

.history-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 6px;
}

.history-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.history-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.history-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    margin-bottom: -1px;
    font: inherit;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color .15s ease;
}

.history-tab:hover {
    color: var(--accent);
}

.history-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.history-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--page);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
}

.history-tab.active .history-tab-count {
    background: rgba(0, 113, 227, 0.12);
    color: var(--accent);
}

.history-tab-remaining {
    font-size: 11px;
    color: var(--text-secondary);
    padding-left: 4px;
    border-left: 1px solid var(--border);
    margin-left: 4px;
}

.history-panel {
    display: none;
}

.history-panel.active {
    display: block;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.history-item-head {
    display: flex;
    align-items: center;
    border-bottom: 1px solid transparent;
}

.history-item.expanded .history-item-head {
    border-bottom-color: var(--border);
}

.history-item-toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    background: transparent;
    border: 0;
    padding: 16px 20px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    color: var(--text);
    min-width: 0;
}

.history-item-toggle:hover {
    background: var(--page);
}

.history-item-date {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.history-item-summary {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.history-item-arrow {
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform .15s ease;
}

.history-item-toggle.expanded .history-item-arrow {
    transform: rotate(180deg);
}

.history-item-delete {
    flex-shrink: 0;
    background: transparent;
    border: 0;
    padding: 8px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    margin-right: 8px;
}

.history-item-delete:hover {
    color: var(--error);
    background: rgba(255, 59, 48, 0.08);
}

.history-item-delete:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.history-item-body {
    padding: 20px;
    background: var(--page);
}

.history-block {
    margin-bottom: 16px;
}

.history-block:last-child {
    margin-bottom: 0;
}

.history-block-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.history-code {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-btn);
    padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    max-height: 320px;
    overflow-y: auto;
}

.history-empty {
    padding: 48px 0;
}

/* —— 移动端适配 —— */
@media (max-width: 768px) {
    .auth-card {
        padding: 24px 20px;
    }

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

    .history-tab {
        padding: 10px 12px;
        font-size: 13px;
    }

    .history-tab-remaining {
        display: none;
    }

    .history-item-toggle {
        padding: 14px 16px;
        gap: 12px;
    }

    .history-item-date {
        font-size: 11px;
    }

    .navbar-register-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

