/**
 * 日语假名学习应用 - 移动端优化样式
 */

/* CSS变量 - 主题色 */
:root {
    --primary-color: #e74c3c;
    --primary-light: #fadbd8;
    --secondary-color: #3498db;
    --secondary-light: #d4e6f1;
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #ecf0f1;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    /* 禁止双指缩放 */
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    /* 禁用iOS橡皮筋效果 */
    overscroll-behavior: none;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 
                 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS视口修正 */
    -webkit-tap-highlight-color: transparent;
    /* 禁止文本选择和缩放 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    /* 禁止iOS双击缩放 */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    /* 禁用overscroll效果 */
    overscroll-behavior: none;
}

/* 头部 */
.header {
    background: linear-gradient(135deg, var(--primary-color), #c0392b);
    color: white;
    padding: 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    /* 防止iOS下拉时露白 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.header-logo {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: contain;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header-logo:active {
    transform: rotate(360deg);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.header .subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 刷新按钮 */
.refresh-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.refresh-btn:active {
    transform: rotate(180deg);
    background: rgba(255, 255, 255, 0.3);
}

/* 假名类型切换 */
.kana-type-tabs {
    display: flex;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.kana-type-tab {
    flex: 1;
    padding: 0.875rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.kana-type-tab.active {
    color: var(--primary-color);
}

.kana-type-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

/* 分类筛选 */
.category-filter {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid var(--border-color);
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.category-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 语音切换 */
.voice-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--secondary-light);
    border-bottom: 1px solid var(--border-color);
}

.voice-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.voice-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--secondary-color);
    border-radius: 16px;
    background: var(--card-bg);
    color: var(--secondary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-btn.active {
    background: var(--secondary-color);
    color: white;
}

/* 主内容区 */
.main-content {
    padding: 1rem;
    padding-bottom: 2rem;
}

/* 假名网格 */
.kana-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.kana-grid.youon {
    grid-template-columns: repeat(3, 1fr);
}

/* 行标签 */
.row-label {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0.5rem 0 0.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.25rem;
}

/* 假名卡片 */
.kana-card {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.kana-card:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-hover);
}

.kana-card.empty {
    background: transparent;
    box-shadow: none;
    cursor: default;
}

.kana-card .char {
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1;
    color: var(--text-primary);
}

.kana-card .romaji {
    font-size: 0.625rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* 播放动画 */
.kana-card.playing {
    animation: pulse 0.3s ease;
}

.kana-card.playing::after {
    content: '🔊';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.625rem;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background: var(--primary-light); }
    100% { transform: scale(1); }
}

/* 提示信息 */
.tip-banner {
    background: linear-gradient(135deg, var(--secondary-light), #e8f4fc);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tip-banner .icon {
    font-size: 1.5rem;
}

.tip-banner .text {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* 底部安全区域（iOS） */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .main-content {
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }
}

/* 响应式调整 */
@media (min-width: 480px) {
    .kana-grid {
        gap: 0.75rem;
    }
    
    .kana-card .char {
        font-size: 2rem;
    }
    
    .kana-card .romaji {
        font-size: 0.75rem;
    }
}

@media (min-width: 768px) {
    .main-content {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .kana-card .char {
        font-size: 2.25rem;
    }
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: var(--text-secondary);
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

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

/* 语音不支持提示 */
.speech-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #856404;
}

/* ========== 页面切换 ========== */
.page {
    display: none;
    padding-bottom: 70px; /* 为底部导航留空间 */
    /* iOS滚动优化 */
    height: 100vh;
    height: -webkit-fill-available;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none; /* 完全禁用overscroll */
    background: var(--bg-color);
}

.page.active {
    display: block;
}

/* ========== 底部导航栏 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
    /* 强制GPU加速，防止iOS滚动时抖动 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.nav-label {
    font-size: 0.75rem;
}

/* ========== 例句页面样式 ========== */
.header-sentences {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* 例句卡片 */
.sentence-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sentence-card:active {
    transform: scale(0.98);
}

.sentence-card.playing {
    border-left: 4px solid var(--secondary-color);
    background: var(--secondary-light);
}

.sentence-jp {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.sentence-romaji {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.sentence-cn {
    font-size: 1rem;
    color: var(--text-secondary);
}

.sentence-category {
    display: inline-block;
    font-size: 0.75rem;
    color: white;
    background: var(--secondary-color);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    margin-top: 0.5rem;
}

.sentence-category.favorite {
    background: linear-gradient(135deg, #f1c40f, #e67e22);
}

/* ========== 词汇页面 ========== */

/* 词汇页面头部 */
.header-vocab {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

/* 类别选择栏 */
.vocab-categories {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

.vocab-categories::-webkit-scrollbar {
    display: none;
}

.vocab-category-btn {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    background: white;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.vocab-category-btn.active {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.vocab-category-btn:active {
    transform: scale(0.95);
}

/* 词汇网格 */
.vocab-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1rem;
}

@media (min-width: 480px) {
    .vocab-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) {
    .vocab-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 词汇卡片 */
.vocab-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s ease;
}

.vocab-card:active {
    transform: scale(0.95);
    background: #f0f0f0;
}

.vocab-card.playing {
    background: #f0fff5;
    box-shadow: 0 0 0 2px #27ae60;
}

.vocab-jp {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.vocab-romaji {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    font-style: italic;
}

.vocab-cn {
    font-size: 0.75rem;
    color: #27ae60;
}

/* 词汇统计信息 */
.vocab-info {
    background: #f0fff5;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.vocab-count {
    font-weight: 600;
    color: #27ae60;
}

/* 例句页面头部信息 */
.sentences-info {
    background: var(--secondary-light);
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.sentences-count {
    font-weight: 600;
    color: var(--secondary-color);
}

/* ========== 控制栏（语音+速度） ========== */
.control-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.control-bar .voice-toggle,
.control-bar .speed-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0;
    background: none;
    border: none;
}

/* 速度切换按钮 */
.speed-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.speed-btn {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.speed-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.speed-btn:hover:not(.active) {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* ========== 我的页面样式 ========== */
.header-mine {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

/* 输入区域 */
.translate-input-area {
    padding: 1rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.input-wrapper {
    position: relative;
}

#translate-input {
    width: 100%;
    padding: 0.75rem;
    padding-right: 4rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    resize: none;
    font-family: inherit;
    box-sizing: border-box;
}

#translate-input:focus {
    outline: none;
    border-color: #9b59b6;
}

.detected-lang {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: #e8e8e8;
    color: #666;
}

.detected-lang.ja {
    background: #ffe6e6;
    color: #e74c3c;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.char-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.translate-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.translate-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* 翻译结果 */
.translate-result {
    margin: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border-left: 4px solid #9b59b6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.translate-result:active {
    transform: scale(0.98);
}

.translate-result.playing {
    background: #f5f0ff;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.result-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #9b59b6;
    transition: width 0.3s ease;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-cn {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.result-jp {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.result-romaji {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* 历史记录 */
.history-header {
    padding: 0.75rem 1rem;
    background: var(--secondary-light);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.history-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.history-card:active {
    transform: scale(0.98);
}

.history-card.playing {
    border-left: 4px solid #9b59b6;
    background: #f5f0ff;
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-cn {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.history-jp {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.history-romaji {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.history-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* 右侧操作按钮区域 */
.history-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    margin-left: 1rem;
    align-self: stretch;
}

.history-fav-btn {
    padding: 0.35rem;
    border: none;
    border-radius: 6px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: #ddd;
    flex-shrink: 0;
    line-height: 1;
}

.history-fav-btn.active {
    color: #f1c40f;
}

.history-fav-btn:hover {
    transform: scale(1.1);
}

.history-delete-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff0f0;
    color: #e08080;
    white-space: nowrap;
}

.history-delete-btn:hover {
    background: #ffe0e0;
    color: #d05050;
}

.history-delete-btn:active {
    background: #ffd0d0;
}

/* 加载更多 */
#load-more-container {
    padding: 1rem;
    text-align: center;
}

.load-more-btn {
    padding: 0.5rem 2rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    border-color: #9b59b6;
    color: #9b59b6;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state-text {
    font-size: 0.9rem;
}

/* ========== 登录/注册页面 ========== */
.auth-page {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 50%, #8e44ad 100%);
    z-index: 9999;
}

.auth-container {
    width: 320px;
    padding: 40px 30px;
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.auth-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    margin-bottom: 16px;
}

.auth-title {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-weight: 700;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

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

.auth-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
}

.auth-input:focus {
    border-color: var(--primary-color);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 4px;
}

.auth-btn:hover {
    background: #c0392b;
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.auth-error {
    color: #e74c3c;
    font-size: 0.85rem;
    min-height: 20px;
    text-align: left;
}

.auth-switch {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* 用户信息栏 */
.user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.user-bar-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-bar-avatar {
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-bar-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-bar-logout {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.user-bar-logout:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.user-bar-logout:active {
    background: #fff5f5;
}
/* ========== 注册表单新增样式 ========== */

.code-input-row {
    display: flex;
    gap: 8px;
}

.code-input-row .code-input {
    flex: 1;
    min-width: 0;
}

.send-code-btn {
    padding: 0 16px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, opacity 0.2s;
    min-width: 100px;
}

.send-code-btn:hover:not(:disabled) {
    background: #c0392b;
}

.send-code-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* 密码强度指示器 */
.pwd-strength {
    text-align: left;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.pwd-rule {
    font-size: 0.78rem;
    color: #e74c3c;
    padding: 2px 0;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pwd-rule.pass {
    color: #27ae60;
}

.pwd-icon {
    font-weight: bold;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

/* 认证容器适配更多内容 */
.auth-container {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-height: 700px) {
    .auth-container {
        padding: 24px 24px;
    }
    .auth-logo {
        width: 56px;
        height: 56px;
        margin-bottom: 10px;
    }
    .auth-title {
        font-size: 1.5rem;
    }
    .auth-subtitle {
        margin-bottom: 16px;
    }
}

/* ========== Forgot Password ========== */
.forgot-link {
    color: #999;
    font-size: 0.82rem;
    text-decoration: none;
    transition: color 0.2s;
}
.forgot-link:hover {
    color: var(--primary-color);
}
.forgot-hint {
    color: #888;
    font-size: 0.85rem;
    text-align: center;
    margin: 0 0 12px 0;
    line-height: 1.5;
}
