/* 用户系统样式：筛选栏、音频切换、登录弹窗（3-tab App 版本） */
/* 注：.btn-favorite / .btn-login / .user-info / .user-area-mine 已移至 style.css 统一管理 */

/* ============ 筛选栏（分组+音切换）============ */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
    padding: 8px;
    background: #2a2a2a;
    border-radius: 6px;
}

.group-selector {
    width: 100%;
    padding: 8px 10px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}
.group-selector:focus {
    outline: none;
    border-color: #666;
}

.audio-toggle {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #aaa;
}
.audio-toggle label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.audio-toggle input[type="radio"] {
    cursor: pointer;
}

/* ============ 登录/注册弹窗 ============ */
.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.auth-modal.show {
    display: flex;
}

.auth-modal-content {
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 24px;
    width: 320px;
    max-width: 90vw;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 0;
}
.auth-modal-close:hover {
    background: #333;
    color: #fff;
}

.auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid #444;
}
.auth-tab {
    flex: 1;
    padding: 8px;
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}
.auth-tab.active {
    color: #6af;
    border-bottom-color: #6af;
}

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

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.auth-field label {
    font-size: 12px;
    color: #aaa;
}
.auth-field input {
    padding: 8px 10px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}
.auth-field input:focus {
    outline: none;
    border-color: #6af;
}

.auth-submit {
    padding: 10px;
    background: linear-gradient(135deg, #4a7a4a 0%, #3a6a3a 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-top: 4px;
}
.auth-submit:hover {
    background: linear-gradient(135deg, #5a8a5a 0%, #4a7a4a 100%);
}
.auth-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.auth-message {
    font-size: 12px;
    min-height: 16px;
    text-align: center;
}
.auth-message.ok {
    color: #6c6;
}
.auth-message.err {
    color: #c66;
}

/* ============ 每日学习目标弹窗 ============ */
.goal-modal-content {
    width: 340px;
    max-width: 92vw;
    max-height: 85vh;
    overflow-y: auto;
    box-sizing: border-box;
}
.goal-modal-title {
    color: #ffc0cb;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
}
.goal-modal-hint {
    color: #888;
    font-size: 12px;
    text-align: center;
    margin-bottom: 18px;
}
.goal-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.goal-quick-btn {
    padding: 10px 0;
    background: #333;
    border: 1px solid #444;
    color: #ccc;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.goal-quick-btn:hover {
    background: #3a3a3a;
    color: #fff;
}
.goal-quick-btn.active {
    background: #4a4a8a;
    border-color: #5a5a9a;
    color: #fff;
}
.goal-quick-btn:active {
    transform: scale(0.96);
}
.goal-custom-field {
    position: relative;
    margin-bottom: 18px;
}
.goal-custom-field input {
    width: 100%;
    padding: 12px 48px 12px 14px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
}
.goal-custom-field input:focus {
    outline: none;
    border-color: #5a5a9a;
}
.goal-group-select {
    width: 100%;
    padding: 12px 14px;
    background: #1a1a1a;
    border: 1px solid #444;
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}
.goal-group-select:focus {
    outline: none;
    border-color: #5a5a9a;
}
.goal-unit {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 13px;
    pointer-events: none;
}
.goal-actions {
    display: flex;
    gap: 10px;
}
.goal-btn-goal-clear,
.goal-btn-goal-confirm {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}
.goal-btn-goal-clear {
    background: #333;
    color: #aaa;
    border: 1px solid #444;
}
.goal-btn-goal-clear:hover {
    background: #3a3a3a;
    color: #ccc;
}
.goal-btn-goal-clear:active {
    background: #2a2a2a;
}
.goal-btn-goal-confirm {
    background: #4a4a8a;
    color: #fff;
}
.goal-btn-goal-confirm:hover {
    background: #5a5a9a;
}
.goal-btn-goal-confirm:active {
    background: #3a3a7a;
}

/* ============ 设置弹窗 ============ */
.settings-modal-content {
    width: 320px;
    padding-bottom: 8px;
}
.settings-modal-title {
    color: #ffc0cb;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
}
.settings-modal-content .settings-list {
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #333;
}
.settings-modal-content .settings-item {
    padding: 14px 16px;
}

/* ============ 单词评论 ============ */

/* Feed 评论按钮 + 角标 */
.feed-btn-comment {
    position: relative;
}
.comment-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ff3b5c;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    font-weight: bold;
}

/* 评论弹窗（复用 .auth-modal 遮罩 + .show） */
.comment-modal-content {
    width: 420px;
    max-width: 94vw;
    max-height: 80vh;
    padding: 16px;
    display: flex;
    flex-direction: column;
}
.comment-modal-title {
    margin: 0 0 12px;
    font-size: 16px;
    color: #fff;
    text-align: center;
    padding-right: 28px;  /* 避开关闭按钮 */
}
.comment-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
    min-height: 120px;
    max-height: 50vh;
}
.comment-empty {
    text-align: center;
    color: #888;
    font-size: 13px;
    padding: 32px 0;
}
.cmt-item {
    display: flex;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid #333;
    align-items: flex-start;
}
.cmt-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b9d, #ff3b5c);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cmt-main {
    flex: 1;
    min-width: 0;
}
.cmt-meta {
    display: flex;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 4px;
}
.cmt-name {
    color: #ff6b9d;
    font-size: 13px;
    font-weight: 600;
}
.cmt-time {
    color: #666;
    font-size: 11px;
}
.cmt-text {
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}
.cmt-audio-play {
    background: rgba(255, 107, 157, 0.15);
    border: 1px solid rgba(255, 107, 157, 0.4);
    color: #ff6b9d;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.cmt-audio-play:active {
    background: rgba(255, 107, 157, 0.3);
}
.cmt-audio-play.playing {
    background: rgba(106, 170, 136, 0.25);
    border-color: #6a8;
    color: #9ed;
}
/* 播放中的均衡器动画（4 根跳动竖条） */
.cmt-eq {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    vertical-align: middle;
    margin-right: 2px;
}
.cmt-eq i {
    display: block;
    width: 3px;
    height: 4px;
    background: #ff6b9d;
    border-radius: 2px;
    animation: cmt-eq-bounce 0.7s ease-in-out infinite;
}
/* 播放中时均衡器竖条跟随按钮变绿 */
.cmt-audio-play.playing .cmt-eq i {
    background: #9ed;
}
.cmt-eq i:nth-child(1) { animation-delay: 0s; }
.cmt-eq i:nth-child(2) { animation-delay: 0.15s; }
.cmt-eq i:nth-child(3) { animation-delay: 0.35s; }
.cmt-eq i:nth-child(4) { animation-delay: 0.2s; }
@keyframes cmt-eq-bounce {
    0%, 100% { height: 3px; }
    50% { height: 14px; }
}
.cmt-del {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #666;
    font-size: 11px;
    cursor: pointer;
    padding: 4px;
    align-self: center;
}
.cmt-del:hover {
    color: #f87171;
}
.cmt-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}
.cmt-reply {
    background: none;
    border: none;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    padding: 4px 6px;
    transition: color 0.15s;
}
.cmt-reply:hover {
    color: #ff6b9d;
}
.cmt-reply-to {
    display: inline-block;
    color: #7aa2f4;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 2px;
}

/* 回复指示条 */
.comment-reply-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 107, 157, 0.1);
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 13px;
}
.comment-reply-text {
    color: #ff6b9d;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.comment-reply-cancel {
    background: none;
    border: none;
    color: #888;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.comment-reply-cancel:hover {
    color: #fff;
}

/* 输入栏 */
.comment-input-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 0 4px;
    border-top: 1px solid #333;
}
.comment-voice-btn {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 107, 157, 0.15);
    border: 1px solid rgba(255, 107, 157, 0.4);
    color: #ff6b9d;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.comment-voice-btn:active {
    background: rgba(255, 107, 157, 0.3);
}
#comment-text-input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 18px;
    color: #fff;
    font-size: 14px;
}
#comment-text-input:focus {
    outline: none;
    border-color: #ff6b9d;
}
.comment-send-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: #ff3b5c;
    border: none;
    border-radius: 18px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
.comment-send-btn:disabled {
    opacity: 0.5;
}

/* 录制中浮层 */
.comment-recording {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: #ff6b9d;
    font-size: 13px;
}
.comment-rec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff3b5c;
    animation: cmt-rec-blink 1s infinite;
}
@keyframes cmt-rec-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.comment-rec-stop {
    margin-left: auto;
    background: rgba(248, 113, 113, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.5);
    color: #f87171;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
}
.comment-hint {
    margin: 6px 0 0;
    color: #555;
    font-size: 11px;
    text-align: center;
}

/* ============ 今日测试（已改为子视图，复用 .sub-view 样式）============ */
.wordlist-modal-content {
    width: 420px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.wordlist-modal-title {
    margin: 0 0 14px;
    font-size: 18px;
    text-align: center;
}
.wordlist-modal-content .word-list-header { margin-bottom: 12px; }
.wordlist-modal-content .word-list { flex: 1; overflow-y: auto; }
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}
.test-round { color: #ffc0cb; font-size: 15px; font-weight: 600; }
.test-progress { color: #888; font-size: 12px; }

.test-question-card {
    text-align: center;
    padding: 28px 12px 20px;
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    border-radius: 12px;
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,0.08);
}
.test-question {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    word-break: break-word;
    line-height: 1.3;
}
.test-phonetic {
    font-size: 15px;
    color: #9aa5ce;
    margin-top: 8px;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.test-speaker {
    background: rgba(255, 192, 203, 0.15);
    border: 1px solid rgba(255, 192, 203, 0.4);
    color: #ffc0cb;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    font-style: normal;
    transition: background 0.15s, transform 0.1s;
}
.test-speaker:active { transform: scale(0.9); }
.test-speaker:hover { background: rgba(255, 192, 203, 0.3); }

.test-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.test-option {
    width: 100%;
    padding: 14px 16px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.test-option:active { transform: scale(0.98); }
.test-option-main { font-size: 16px; font-weight: 500; }
.test-option-sub { font-size: 12px; color: #888; display: none; }
.test-option.revealed .test-option-sub { display: block; }
.test-option.correct {
    background: rgba(106,170,136,0.25);
    border-color: #6a8;
    color: #9ed;
}
.test-option.correct .test-option-sub { color: #7a9; }
.test-option.wrong {
    background: rgba(220,80,80,0.25);
    border-color: #d55;
    color: #fbb;
}
.test-option.wrong .test-option-sub { color: #a88; }

/* 测试导航按钮（上一题/下一题/完成） */
.test-nav {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 18px;
}
.test-nav-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.test-nav-btn:active { transform: scale(0.97); }
.test-nav-prev {
    background: #333;
    color: #ccc;
    border: 1px solid #444;
}
.test-nav-prev:hover { background: #3a3a3a; }
.test-nav-next {
    background: #6a8;
    color: #fff;
}
.test-nav-next:hover { background: #7b9; }
.test-nav-finish {
    background: #4a4a8a;
    color: #fff;
}
.test-nav-finish:hover { background: #5a5a9a; }
/* 仅一个按钮时居右 */
.test-nav:has(.test-nav-btn:only-child) { justify-content: flex-end; }

/* 测试结果页 */
.test-result { text-align: center; padding: 30px 12px; }
.test-result-icon { font-size: 48px; margin-bottom: 12px; }
.test-result-title { font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 14px; }
.test-result-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 14px;
}
.test-stat-pass { color: #6a8; }
.test-stat-fail { color: #d55; }
.test-result-desc { color: #888; font-size: 13px; margin-bottom: 20px; }
.test-result-actions { display: flex; gap: 10px; justify-content: center; }
.test-btn {
    padding: 10px 24px;
    background: #6a8;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.test-btn:active { opacity: 0.85; }
.test-btn-retry {
    background: #60a5fa;
}
