/* ============================================================
 * 影视猜词游戏 - 独立样式
 * 不依赖主站任何CSS
 * ============================================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    transition: background .3s, color .3s;
}

body[data-theme="dark"] {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* ---- 头部 ---- */
.quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
body[data-theme="dark"] .quiz-header {
    background: linear-gradient(135deg, #2d3561 0%, #3a1e5e 100%);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.quiz-header .logo {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.quiz-nav {
    display: flex;
    gap: 16px;
}
.quiz-nav a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: .9rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .2s;
}
.quiz-nav a:hover, .quiz-nav a.active {
    background: rgba(255,255,255,.2);
    color: #fff;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.credits-badge {
    background: rgba(255,255,255,.2);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: .85rem;
}
.username-tag, .guest-tag {
    color: rgba(255,255,255,.9);
    font-size: .85rem;
}
.header-right .btn {
    padding: 4px 12px;
    font-size: .8rem;
}

/* ---- 主题切换 ---- */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #667eea;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- 主体 ---- */
.quiz-main {
    max-width: 800px;
    margin: 30px auto;
    padding: 0 16px;
}

.quiz-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ---- 面板通用 ---- */
.quiz-panel {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
body[data-theme="dark"] .quiz-panel {
    background: #16213e;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}

/* ---- 开始界面 ---- */
#quizStart { text-align: center; }
#quizStart h1 {
    font-size: 2rem;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.quiz-desc {
    color: #666;
    margin-bottom: 24px;
}
body[data-theme="dark"] .quiz-desc { color: #aaa; }

.quiz-rules, .quiz-levels {
    text-align: left;
    background: #f8f9ff;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
body[data-theme="dark"] .quiz-rules,
body[data-theme="dark"] .quiz-levels {
    background: #1e2a4a;
}
.quiz-rules h3, .quiz-levels h3 {
    margin-bottom: 10px;
    font-size: 1rem;
}
.quiz-rules ul, .quiz-levels ul {
    list-style: none;
    padding: 0;
}
.quiz-rules li {
    padding: 4px 0;
    font-size: .9rem;
    color: #555;
}
body[data-theme="dark"] .quiz-rules li { color: #bbb; }

.level-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.level-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
}
.level-badge.l5 { background: #ffd700; color: #7a5c00; }
.level-badge.l4 { background: #c0c0c0; color: #444; }
.level-badge.l3 { background: #cd7f32; color: #fff; }
.level-badge.l2 { background: #e8e8e8; color: #555; }
.level-badge.l1 { background: #f0e6ff; color: #6a3ea1; }

/* ---- 按钮 ---- */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .15s;
    font-weight: 500;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.btn-outline { background: transparent; border: 2px solid #667eea; color: #667eea; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 14px 36px; font-size: 1.1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- 游戏界面 ---- */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}
body[data-theme="dark"] .game-header { border-color: #2a3a5a; }
.game-progress {
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
}
.game-score {
    font-size: 1rem;
    color: #555;
}
body[data-theme="dark"] .game-score { color: #bbb; }

/* ---- 词语显示 ---- */
.word-display {
    text-align: center;
    margin: 30px 0;
}
.word-blanks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}
.blank-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 48px;
    border-bottom: 3px solid #667eea;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0 2px;
}
body[data-theme="dark"] .blank-letter { color: #e0e0e0; }
.blank-letter.revealed {
    color: #667eea;
    border-bottom-color: #764ba2;
    animation: popIn .3s ease;
}
.blank-space {
    display: inline-block;
    width: 16px;
}
@keyframes popIn {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.word-category {
    font-size: .9rem;
    color: #888;
    margin-top: 8px;
}

/* ---- 答题区 ---- */
.answer-area {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}
.answer-area input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color .2s;
    background: #fff;
    color: #333;
}
body[data-theme="dark"] .answer-area input {
    background: #1e2a4a;
    border-color: #3a4a6a;
    color: #e0e0e0;
}
.answer-area input:focus {
    border-color: #667eea;
}

/* ---- 提示区 ---- */
.hints-area {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
body[data-theme="dark"] .hints-area { background: #1e2a4a; }
.hints-area h4 {
    font-size: .95rem;
    margin-bottom: 10px;
    color: #555;
}
body[data-theme="dark"] .hints-area h4 { color: #bbb; }
.hint-list {
    margin-bottom: 12px;
    min-height: 30px;
}
.hint-item {
    padding: 8px 12px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: .9rem;
    border-left: 3px solid #667eea;
    animation: slideIn .3s ease;
}
body[data-theme="dark"] .hint-item { background: #16213e; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}
.hint-tag {
    display: inline-block;
    background: #667eea;
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: .75rem;
    margin-right: 6px;
}

/* ---- 结果消息 ---- */
.result-msg {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.result-msg.success { background: #d1fae5; color: #065f46; }
.result-msg.error   { background: #fee2e2; color: #991b1b; }
.result-msg.skip    { background: #fef3c7; color: #92400e; }

/* ---- 结果界面 ---- */
#quizResult { text-align: center; }
#quizResult h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}
.result-card {
    background: linear-gradient(135deg, #667eea15, #764ba215);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}
.result-score {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.result-level {
    font-size: 1.5rem;
    margin: 12px 0;
    font-weight: 700;
}
.result-detail p {
    font-size: 1rem;
    color: #555;
    margin: 4px 0;
}
body[data-theme="dark"] .result-detail p { color: #bbb; }
.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ---- 排行榜 ---- */
.leaderboard-panel {
    background: #fff;
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
body[data-theme="dark"] .leaderboard-panel { background: #16213e; }
.leaderboard-panel h2 {
    margin-bottom: 16px;
    font-size: 1.2rem;
}
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}
.leaderboard-table th {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 2px solid #f0f0f0;
    font-size: .85rem;
    color: #888;
}
body[data-theme="dark"] .leaderboard-table th { border-color: #2a3a5a; }
.leaderboard-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f5f5f5;
    font-size: .9rem;
}
body[data-theme="dark"] .leaderboard-table td { border-color: #1e2a4a; }
.leaderboard-table tr:first-child td {
    font-weight: 700;
}

/* ---- 表单（后台/我的词语） ---- */
.quiz-form {
    max-width: 500px;
}
.form-row {
    margin-bottom: 16px;
}
.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: .9rem;
}
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: .95rem;
    outline: none;
    background: #fff;
    color: #333;
}
body[data-theme="dark"] .form-row input,
body[data-theme="dark"] .form-row select,
body[data-theme="dark"] .form-row textarea {
    background: #1e2a4a;
    border-color: #3a4a6a;
    color: #e0e0e0;
}
.form-row input:focus,
.form-row select:focus {
    border-color: #667eea;
}

/* ---- 后台布局 ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 220px;
    background: #1a1a2e;
    padding: 20px 0;
    flex-shrink: 0;
}
.admin-logo {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    margin-bottom: 16px;
}
.admin-nav {
    display: flex;
    flex-direction: column;
}
.admin-nav a {
    color: rgba(255,255,255,.7);
    text-decoration: none;
    padding: 10px 20px;
    font-size: .9rem;
    transition: background .2s;
}
.admin-nav a:hover, .admin-nav a.active {
    background: rgba(255,255,255,.1);
    color: #fff;
}
.admin-main {
    flex: 1;
    padding: 24px;
    background: #f0f2f5;
}
body[data-theme="dark"] .admin-main { background: #1a1a2e; }
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-header h1 { font-size: 1.4rem; }
.admin-user { color: #555; font-size: .9rem; }
body[data-theme="dark"] .admin-user { color: #bbb; }

.admin-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
body[data-theme="dark"] .admin-section { background: #16213e; }
.admin-section h2 {
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.admin-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
body[data-theme="dark"] .stat-card { background: #16213e; }
.stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #667eea;
}
.stat-label {
    font-size: .85rem;
    color: #888;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}
.admin-table th {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 2px solid #eee;
    color: #666;
}
body[data-theme="dark"] .admin-table th { border-color: #2a3a5a; }
.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f5f5f5;
}
body[data-theme="dark"] .admin-table td { border-color: #1e2a4a; }

/* ---- 徽章 ---- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .75rem;
    background: #e0e7ff;
    color: #4338ca;
}
.badge-info    { background: #dbeafe; color: #1d4ed8; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger  { background: #fee2e2; color: #991b1b; }

/* ---- 提示消息 ---- */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .9rem;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error   { background: #fee2e2; color: #991b1b; }

/* ---- 页脚 ---- */
.site-footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: .85rem;
}

/* ---- 响应式 ---- */
@media (max-width: 600px) {
    .header-inner { flex-wrap: wrap; height: auto; padding: 8px 0; }
    .quiz-nav { order: 3; width: 100%; margin-top: 8px; }
    .answer-area { flex-direction: column; }
    .answer-area .btn { width: 100%; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .admin-stats { flex-direction: column; }
    .blank-letter { width: 32px; height: 40px; font-size: 1.2rem; }
}
