/* ============================================================
   规则怪谈 - Horror Rule Game Styles (黑白灰极简风格)
   ============================================================ */

/* --- 主页 --- */
.horror-home {
    padding: 16px;
    overflow-y: auto;
    height: 100%;
    background: #fff;
    box-sizing: border-box;
}
.horror-home-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #000;
    margin: 20px 0 8px;
    letter-spacing: 4px;
}
.horror-home-subtitle {
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
}
.horror-mode-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 4px;
}
.horror-mode-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.horror-mode-card:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.horror-mode-card-icon {
    font-size: 36px;
    margin-bottom: 10px;
}
.horror-mode-card-name {
    font-size: 18px;
    font-weight: 700;
    color: #000;
    margin-bottom: 6px;
}
.horror-mode-card-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.6;
}
.horror-mode-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: none;
    pointer-events: none;
}

/* 历史记录 */
.horror-history-section {
    margin-top: 24px;
}
.horror-history-title {
    font-size: 14px;
    color: #999;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.horror-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.horror-history-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}
.horror-history-item:active { background: #f5f5f5; }
.horror-history-item-left { flex: 1; }
.horror-history-item-name {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}
.horror-history-item-meta {
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
}
.horror-history-item-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.horror-history-item-status.ongoing { background: #eee; color: #666; }
.horror-history-item-status.won { background: #e8e8e8; color: #555; }
.horror-history-item-status.lost { background: #f0f0f0; color: #aaa; }

/* --- 论坛体模式 --- */
.horror-forum {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}
.horror-forum-header {
    background: #fff;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}
.horror-forum-board-name {
    font-size: 12px;
    color: #333;
    margin-bottom: 4px;
}
.horror-forum-post-title {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    line-height: 1.4;
}
.horror-forum-post-meta {
    font-size: 11px;
    color: #aaa;
    margin-top: 6px;
    display: flex;
    gap: 12px;
}
.horror-forum-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.horror-forum-op {
    background: #fff;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}
.horror-forum-op-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    float: left;
    margin-right: 10px;
}
.horror-forum-op-name {
    font-size: 13px;
    font-weight: 600;
    color: #000;
}
.horror-forum-op-tag {
    font-size: 10px;
    background: #eee;
    color: #333;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}
.horror-forum-op-content {
    font-size: 14px;
    color: #333;
    line-height: 1.8;
    margin-top: 8px;
    clear: both;
    white-space: pre-wrap;
}

/* 回帖 */
.horror-reply {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    position: relative;
}
.horror-reply.is-op { background: #f9f9f9; }
.horror-reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.horror-reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}
.horror-reply-name {
    font-size: 12px;
    font-weight: 600;
    color: #666;
}
.horror-reply-name.op-name { color: #000; }
.horror-reply-floor {
    font-size: 10px;
    color: #bbb;
    margin-left: auto;
}
.horror-reply-content {
    font-size: 13px;
    color: #333;
    line-height: 1.7;
    padding-left: 36px;
    white-space: pre-wrap;
}
.horror-reply-quote {
    background: #f5f5f5;
    border-left: 2px solid #ccc;
    padding: 6px 10px;
    margin: 0 0 8px 36px;
    font-size: 12px;
    color: #999;
    border-radius: 0 6px 6px 0;
}
.horror-reply-actions {
    display: flex;
    gap: 16px;
    padding-left: 36px;
    margin-top: 6px;
}
.horror-reply-action {
    font-size: 11px;
    color: #bbb;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.horror-reply-action:active { color: #000; }

/* 论坛输入栏 */
.horror-forum-input-bar {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.horror-forum-input {
    flex: 1;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 14px;
    color: #333;
    font-size: 13px;
    outline: none;
    resize: none;
    max-height: 80px;
    min-height: 36px;
    line-height: 1.4;
}
.horror-forum-input::placeholder { color: #bbb; }
.horror-forum-send-btn {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.horror-forum-send-btn:disabled {
    background: #ccc;
    color: #fff;
}

/* 论坛角色信息/轮数提示 */
.horror-forum-role-bar {
    background: #f5f5f5;
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}
.horror-forum-role-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
}
.horror-forum-role-tag.role-lurker { background: #eee; color: #555; }
.horror-forum-role-tag.role-poster { background: #e0e0e0; color: #333; }
.horror-forum-round-info {
    font-size: 11px;
    color: #999;
}

/* --- 沉浸探索模式 --- */
.horror-explore {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
}
.horror-explore-scene {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.horror-explore-narrative {
    font-size: 14px;
    color: #333;
    line-height: 1.9;
    white-space: pre-wrap;
    margin-bottom: 16px;
}
.horror-explore-narrative .highlight {
    color: #000;
    font-weight: 600;
}
.horror-explore-event {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px;
    margin: 12px 0;
    animation: horror-pulse 2s infinite;
}
@keyframes horror-pulse {
    0%, 100% { border-color: #e0e0e0; }
    50% { border-color: #bbb; }
}
.horror-explore-event-title {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    margin-bottom: 6px;
}
.horror-explore-event-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

/* 规则纸条 */
.horror-rules-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #333;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
}
.horror-rules-btn .badge {
    background: #333;
    color: #fff;
    font-size: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.horror-rules-panel {
    position: absolute;
    top: 40px;
    right: 12px;
    width: 260px;
    max-height: 60vh;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    z-index: 20;
    overflow-y: auto;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.horror-rules-panel.show { display: block; }
.horror-rules-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
    text-align: center;
}
.horror-rule-item {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #333;
    line-height: 1.6;
    position: relative;
}
.horror-rule-item.new-rule {
    border-color: #ccc;
    animation: horror-new-rule 1s ease;
}
@keyframes horror-new-rule {
    0% { transform: translateX(20px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
.horror-rule-item-num {
    font-weight: 700;
    color: #000;
    margin-right: 4px;
}
.horror-rule-item.contradicts {
    border-color: #bbb;
    background: #f5f5f5;
}
.horror-rule-item.contradicts .horror-rule-item-num { color: #666; }

/* 选择面板 */
.horror-choices {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 12px;
}
.horror-choices-title {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}
.horror-choice-btn {
    display: block;
    width: 100%;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 8px;
    color: #333;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.5;
}
.horror-choice-btn:active {
    background: #eee;
    border-color: #333;
}
.horror-choice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 状态栏 */
.horror-status-bar {
    background: #fafafa;
    border-top: 1px solid #eee;
    padding: 8px 14px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
}
.horror-status-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 结局画面 */
.horror-ending {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.97);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 30;
    padding: 40px 30px 30px;
    text-align: center;
    overflow-y: auto;
}
.horror-ending-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
.horror-ending-title {
    font-size: 20px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
}
.horror-ending-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 24px;
    max-width: 300px;
}
.horror-ending-btn {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 32px;
    font-size: 14px;
    cursor: pointer;
    margin: 4px;
}
.horror-ending-btn.secondary {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

/* 加载动画 */
.horror-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #999;
    font-size: 13px;
    gap: 12px;
}
.horror-loading i {
    font-size: 24px;
    color: #333;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 模式选择弹窗 */
.horror-role-select {
    padding: 24px 16px;
    text-align: center;
    background: #fff;
    height: 100%;
    box-sizing: border-box;
}
.horror-role-select-title {
    font-size: 16px;
    font-weight: 700;
    color: #000;
    margin-bottom: 16px;
}
.horror-role-select-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.horror-role-btn {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}
.horror-role-btn:active {
    border-color: #333;
    background: #f5f5f5;
}
.horror-role-btn-name {
    font-size: 15px;
    font-weight: 700;
    color: #000;
    margin-bottom: 4px;
}
.horror-role-btn-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.5;
}

/* 论坛体 typing 指示器 */
.horror-typing {
    padding: 8px 16px 8px 52px;
    font-size: 12px;
    color: #bbb;
    display: flex;
    align-items: center;
    gap: 6px;
}
.horror-typing-dots span {
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #bbb;
    border-radius: 50%;
    animation: horror-typing-dot 1.4s infinite;
}
.horror-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.horror-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes horror-typing-dot {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* 深度思考/真相揭示 */
.horror-truth-reveal {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px;
    margin: 12px 16px;
}
.horror-truth-reveal-title {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}
.horror-truth-reveal-content {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* ============================================================
   联系人同伴系统样式
   ============================================================ */

/* 联系人选择界面 */
.horror-select-contact { padding: 16px; height: 100%; display: flex; flex-direction: column; background: #fff; box-sizing: border-box; }
.horror-select-header { text-align: center; padding: 16px 0; }
.horror-select-title { font-size: 20px; font-weight: 700; color: #000; margin-bottom: 6px; }
.horror-select-subtitle { font-size: 13px; color: #999; }
.horror-contact-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.horror-contact-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; cursor: pointer; transition: background 0.15s; }
.horror-contact-item:active { background: #f5f5f5; }
.horror-contact-item.selected { background: #f0f7ff; }
.horror-contact-avatar { flex-shrink: 0; }
.horror-contact-name { flex: 1; font-size: 15px; color: #222; }
.horror-contact-check { font-size: 18px; color: #ccc; }
.horror-contact-item.selected .horror-contact-check { color: #333; }
.horror-no-contacts { text-align: center; padding: 40px 0; color: #999; font-size: 14px; }
.horror-select-actions { display: flex; gap: 10px; padding: 12px 0 0; }
.horror-select-btn { flex: 1; padding: 12px; border: none; border-radius: 12px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.horror-select-btn.skip { background: #f0f0f0; color: #666; }
.horror-select-btn.confirm { background: #222; color: #fff; }
.horror-select-btn:active { transform: scale(0.97); }

/* 沉浸式探索：同伴对话气泡 */
.horror-companion-bubble { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; margin: 6px 0; background: rgba(240,245,255,0.7); border-radius: 12px; border-left: 3px solid #aac; }
.horror-companion-avatar { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #e8e8e8; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #666; }
.horror-companion-avatar img { width: 100%; height: 100%; object-fit: cover; }
.horror-companion-msg { flex: 1; min-width: 0; }
.horror-companion-name { font-size: 11px; color: #999; margin-bottom: 2px; }
.horror-companion-text { font-size: 13px; color: #444; line-height: 1.5; }

/* 同伴状态栏 */
.horror-companion-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; margin-bottom: 4px; }
.horror-companion-icon { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; border: 2px solid #ddd; display: flex; align-items: center; justify-content: center; font-size: 12px; background: #f5f5f5; }
.horror-companion-icon img { width: 100%; height: 100%; object-fit: cover; }
.horror-companion-icon.injured { border-color: #e74c3c; opacity: 0.6; }
.horror-help-btn { margin-left: auto; padding: 4px 10px; background: #fff; border: 1px solid #ddd; border-radius: 16px; font-size: 12px; cursor: pointer; transition: all 0.2s; }
.horror-help-btn:active { background: #f0f0f0; transform: scale(0.95); }

/* 论坛体：手机道具面板 */
.horror-phone-panel { position: fixed; bottom: 0; left: 0; right: 0; max-height: 50vh; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,0.15); z-index: 100; transform: translateY(100%); transition: transform 0.3s ease; overflow: hidden; display: flex; flex-direction: column; }
.horror-phone-panel.show { transform: translateY(0); }
.horror-phone-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #f0f0f0; font-size: 14px; font-weight: 600; }
.horror-phone-close { cursor: pointer; font-size: 16px; color: #999; padding: 4px; }
.horror-phone-messages { flex: 1; overflow-y: auto; padding: 8px 12px; }
.horror-phone-msg { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f8f8f8; }
.horror-phone-msg:last-child { border-bottom: none; }
.horror-phone-msg-avatar { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #e8e8e8; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.horror-phone-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.horror-phone-msg-name { font-size: 11px; color: #999; margin-bottom: 2px; }
.horror-phone-msg-text { font-size: 13px; color: #333; line-height: 1.4; }
.horror-phone-msg-body { flex: 1; }

/* 模式卡片标签 */
.horror-mode-card-tag { display: inline-block; margin-top: 8px; padding: 3px 10px; background: #f0f7ff; color: #5588cc; font-size: 11px; border-radius: 10px; }

/* 论坛体：手机按钮 — [FIX-弹性保护带] bottom从保护带出发 */
.horror-phone-btn { position: fixed; bottom: calc(var(--guard-bottom, 12px) + 60px); right: var(--guard-right, 16px); width: 44px; height: 44px; border-radius: 50%; background: #222; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.2); z-index: 90; transition: transform 0.2s; }
.horror-phone-btn:active { transform: scale(0.9); }
.horror-phone-badge { position: absolute; top: -2px; right: -2px; width: 16px; height: 16px; background: #e74c3c; color: #fff; font-size: 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
