@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=ZCOOL+XiaoWei&family=Noto+Serif+SC:wght@400;700&display=swap');

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

body {
    font-family: 'Noto Serif SC', 'ZCOOL XiaoWei', 'SimSun', 'Microsoft YaHei', serif;
    background: #f4f0e8;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(200, 180, 150, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(180, 200, 170, 0.1) 0%, transparent 50%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    position: relative;
    color: #3a3228;
}

/* Subtle ink wash texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 15% 25%, rgba(120, 100, 80, 0.04) 0%, transparent 100%),
        radial-gradient(2px 2px at 45% 70%, rgba(120, 100, 80, 0.03) 0%, transparent 100%),
        radial-gradient(2px 2px at 75% 15%, rgba(120, 100, 80, 0.04) 0%, transparent 100%),
        radial-gradient(2px 2px at 85% 55%, rgba(120, 100, 80, 0.03) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* ========== App Layout ========== */

.app-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
    max-width: 1440px;
    position: relative;
    z-index: 1;
}

.container {
    background: rgba(255, 253, 248, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(160, 140, 110, 0.2);
    border-radius: 12px;
    padding: 40px;
    max-width: 560px;
    width: 100%;
    flex-shrink: 1;
    min-width: 380px;
    box-shadow: 0 4px 30px rgba(100, 80, 60, 0.08);
}

/* ========== Language Selector ========== */

.language-selector {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 20px;
    gap: 10px;
}

.language-selector label {
    font-size: 0.85em;
    color: #8a7a68;
    font-weight: bold;
}

.language-select {
    padding: 6px 10px;
    font-size: 0.85em;
    border: 1px solid rgba(160, 140, 110, 0.3);
    border-radius: 6px;
    background: rgba(255, 253, 248, 0.8);
    color: #5a4a38;
    cursor: pointer;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.language-select:hover,
.language-select:focus {
    outline: none;
    border-color: rgba(160, 140, 110, 0.6);
}

.music-btn {
    padding: 6px 10px;
    font-size: 0.85em;
    border: 1px solid rgba(160, 140, 110, 0.3);
    border-radius: 6px;
    background: rgba(255, 253, 248, 0.8);
    color: #5a4a38;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.music-btn:hover {
    border-color: rgba(160, 140, 110, 0.6);
    background: rgba(255, 253, 248, 1);
}

.music-btn.playing {
    background: rgba(200, 170, 110, 0.3);
    border-color: rgba(200, 170, 110, 0.5);
    color: #c8aa6e;
}

.language-select option {
    background: #f8f5ee;
    color: #5a4a38;
}

/* ========== Header ========== */

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

h1 {
    text-align: center;
    color: #4a3c2a;
    font-family: 'Ma Shan Zheng', 'ZCOOL XiaoWei', cursive;
    font-size: 2.8em;
    margin-bottom: 10px;
    letter-spacing: 6px;
    font-weight: normal;
}

.subtitle {
    text-align: center;
    color: #9a8a78;
    font-size: 1em;
    margin-bottom: 40px;
    letter-spacing: 3px;
}

.user-menu-btn {
    background: rgba(160, 140, 110, 0.1);
    color: #7a6a58;
    border: 1px solid rgba(160, 140, 110, 0.25);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-btn:hover {
    background: rgba(160, 140, 110, 0.2);
    border-color: rgba(160, 140, 110, 0.4);
}

.user-icon {
    font-size: 1.2em;
}

/* ========== Question Input ========== */

.question-container {
    margin-bottom: 30px;
    text-align: center;
}

.question-container label {
    display: block;
    margin-bottom: 10px;
    color: #7a6a58;
    font-weight: bold;
    font-size: 0.95em;
}

.question-input {
    width: 100%;
    max-width: 500px;
    padding: 12px 16px;
    font-size: 1em;
    border: 1px solid rgba(160, 140, 110, 0.25);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    color: #3a3228;
    transition: all 0.3s ease;
    font-family: inherit;
}

.question-input:focus {
    outline: none;
    border-color: rgba(120, 100, 70, 0.5);
    box-shadow: 0 0 12px rgba(160, 140, 110, 0.1);
}

.question-input::placeholder {
    color: #b5a898;
}

/* ========== Coins ========== */

.coins-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 40px 0;
    min-height: 120px;
}

.coin {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: url('front.jpg') no-repeat center center;
    background-size: contain;
    box-shadow: 0 4px 15px rgba(100, 80, 60, 0.15);
    transition: transform 0.3s ease;
    position: relative;
}

.coin.heads {
    background: url('front.jpg') no-repeat center center;
    background-size: contain;
}

.coin.tails {
    background: url('back.jpg') no-repeat center center;
    background-size: contain;
}

.coin.tossing {
    animation: toss 0.5s ease-in-out;
}

@keyframes toss {
    0% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(180deg) scale(1.2); }
    100% { transform: rotateY(360deg) scale(1); }
}

/* ========== Toss Button ========== */

.toss-btn {
    display: block;
    width: 100%;
    padding: 16px 30px;
    font-size: 1.5em;
    font-weight: bold;
    font-family: 'Ma Shan Zheng', 'ZCOOL XiaoWei', cursive;
    color: #fff;
    background: linear-gradient(135deg, #7a6a52 0%, #5a4a38 50%, #7a6a52 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(100, 80, 60, 0.2);
    letter-spacing: 4px;
}

.toss-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(100, 80, 60, 0.3);
}

.toss-btn:active {
    transform: translateY(0);
}

.toss-btn:disabled {
    background: rgba(160, 140, 110, 0.3);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========== Toss Progress ========== */

.toss-progress {
    margin-top: 20px;
    text-align: center;
    display: none;
}

.toss-progress.show {
    display: block;
}

.progress-text {
    font-size: 1.1em;
    color: #5a4a38;
    font-weight: bold;
}

.toss-instruction {
    margin-top: 15px;
    text-align: center;
    font-size: 0.95em;
    color: #a09888;
    font-style: italic;
}

/* ========== Toss Results ========== */

.toss-results {
    margin-top: 20px;
    padding: 15px;
    background: rgba(240, 235, 225, 0.5);
    border: 1px solid rgba(160, 140, 110, 0.12);
    border-radius: 10px;
    display: none;
}

.toss-results.show {
    display: block;
}

.toss-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(160, 140, 110, 0.08);
}

.toss-result-item:last-child {
    margin-bottom: 0;
}

.toss-number {
    font-weight: bold;
    color: #7a6a58;
    font-size: 1em;
    min-width: 80px;
}

.toss-yao {
    font-size: 1.8em;
    color: #5a4a38;
    font-weight: bold;
    flex-grow: 1;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.yao-rect {
    width: 80px;
    height: 12px;
    border: 2px solid #6a5a48;
    border-radius: 2px;
    background-color: transparent;
    position: relative;
}

.yao-yang .yao-rect {
    background-color: #6a5a48;
}

.yao-yin .yao-rect {
    background-color: transparent;
    position: relative;
    overflow: hidden;
}

.yao-yin .yao-rect::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: calc(50% - 10px);
    background-color: #6a5a48;
}

.yao-yin .yao-rect::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: calc(50% - 10px);
    background-color: #6a5a48;
}

.yao-old-yang .yao-rect {
    background-color: #b85c3a;
    border-color: #b85c3a;
}

.yao-old-yin .yao-rect {
    background-color: transparent;
    border-color: #b85c3a;
    position: relative;
    overflow: hidden;
}

.yao-old-yin .yao-rect::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: calc(50% - 10px);
    background-color: #b85c3a;
}

.yao-old-yin .yao-rect::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: calc(50% - 10px);
    background-color: #b85c3a;
}

.toss-yao-name {
    font-size: 0.95em;
    color: #a09888;
    min-width: 80px;
    text-align: right;
}

/* ========== Result Container ========== */

.result-container {
    margin-top: 40px;
    padding: 30px;
    background: rgba(240, 235, 225, 0.5);
    border: 1px solid rgba(160, 140, 110, 0.15);
    border-radius: 12px;
    display: none;
}

.result-container.show {
    display: block;
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.gua-name {
    text-align: center;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.2em;
    font-weight: normal;
    color: #4a3c2a;
    margin-bottom: 20px;
    letter-spacing: 4px;
}

.gua-symbol {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    border: 1px solid rgba(160, 140, 110, 0.1);
}

.gua-yao-line {
    font-size: 2.5em;
    line-height: 1.2;
    color: #5a4a38;
    font-weight: bold;
    letter-spacing: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 0;
}

.gua-yao-line .yao-rect {
    width: 120px;
    height: 16px;
    border: 3px solid #6a5a48;
    border-radius: 3px;
    background-color: transparent;
    position: relative;
}

.gua-yao-line.yao-yang .yao-rect {
    background-color: #6a5a48;
}

.gua-yao-line.yao-yin .yao-rect {
    background-color: transparent;
    position: relative;
    overflow: hidden;
}

.gua-yao-line.yao-yin .yao-rect::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: calc(50% - 15px);
    background-color: #6a5a48;
}

.gua-yao-line.yao-yin .yao-rect::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: calc(50% - 15px);
    background-color: #6a5a48;
}

.gua-yao-line.yao-old-yang .yao-rect {
    background-color: #b85c3a;
    border-color: #b85c3a;
}

.gua-yao-line.yao-old-yin .yao-rect {
    background-color: transparent;
    border-color: #b85c3a;
    position: relative;
    overflow: hidden;
}

.gua-yao-line.yao-old-yin .yao-rect::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: calc(50% - 15px);
    background-color: #b85c3a;
}

.gua-yao-line.yao-old-yin .yao-rect::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: calc(50% - 15px);
    background-color: #b85c3a;
}

.gua-meaning {
    text-align: left;
    font-size: 1em;
    color: #4a3c2a;
    line-height: 2;
}

.gua-section {
    margin-bottom: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    border-left: 3px solid rgba(120, 100, 70, 0.4);
}

.gua-section:last-child {
    margin-bottom: 0;
}

.gua-section strong {
    color: #5a4a38;
    display: block;
    margin-bottom: 8px;
    font-size: 1.05em;
    font-family: 'Ma Shan Zheng', cursive;
    font-weight: normal;
    letter-spacing: 2px;
}

/* ========== Najia Analysis ========== */

.najia-container {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px dashed rgba(160, 140, 110, 0.3);
}

.najia-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.2em;
    font-weight: normal;
    color: #5a4a38;
    letter-spacing: 3px;
    margin-bottom: 12px;
    text-align: center;
}

.najia-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #7a6a58;
    margin-bottom: 14px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
}

.najia-palace {
    font-weight: bold;
    color: #5a4a38;
}

.najia-table {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.najia-line {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.88em;
    color: #5a4a38;
    background: rgba(255, 252, 245, 0.5);
}

.najia-line:hover {
    background: rgba(255, 252, 245, 0.9);
}

.najia-line.najia-moving {
    background: rgba(185, 92, 58, 0.08);
    border-left: 2px solid #b85c3a;
}

.najia-spirit {
    width: 52px;
    flex-shrink: 0;
    font-size: 0.85em;
    color: #8a7a68;
}

.najia-yao {
    width: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 6px;
}

.najia-yao-line {
    width: 48px;
    height: 4px;
    position: relative;
}

.najia-yang .najia-yao-line {
    background: #5a4a38;
}

.najia-yin .najia-yao-line {
    background: transparent;
}

.najia-yin .najia-yao-line::before,
.najia-yin .najia-yao-line::after {
    content: '';
    position: absolute;
    top: 0;
    height: 100%;
    width: 42%;
    background: #5a4a38;
}

.najia-yin .najia-yao-line::before { left: 0; }
.najia-yin .najia-yao-line::after { right: 0; }

.najia-branch {
    width: 40px;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.9em;
}

.najia-relation {
    width: 40px;
    flex-shrink: 0;
    text-align: center;
    font-size: 0.85em;
    color: #7a6a58;
}

.najia-shiying {
    width: 28px;
    flex-shrink: 0;
    text-align: center;
}

.najia-shi {
    color: #b85c3a;
    font-weight: bold;
    font-size: 0.85em;
}

.najia-ying {
    color: #4a7a5a;
    font-weight: bold;
    font-size: 0.85em;
}

.najia-arrow {
    color: #b85c3a;
    font-size: 0.85em;
    margin-left: 4px;
}

.najia-biangua {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dotted rgba(160, 140, 110, 0.25);
}

.najia-biangua-title {
    font-size: 0.9em;
    color: #7a6a58;
    margin-bottom: 8px;
    font-weight: bold;
}

.najia-biangua-table .najia-line {
    opacity: 0.75;
}

.najia-bian-line .najia-spirit {
    visibility: hidden;
}

@media (max-width: 1200px) {
    .najia-spirit { width: 42px; font-size: 0.78em; }
    .najia-yao { width: 48px; }
    .najia-yao-line { width: 38px; }
    .najia-branch { width: 35px; font-size: 0.82em; }
    .najia-relation { width: 35px; font-size: 0.78em; }
    .najia-line { padding: 4px 4px; font-size: 0.82em; }
}

/* ========== History ========== */

.history-container {
    margin-top: 40px;
    padding: 20px;
    background: rgba(240, 235, 225, 0.4);
    border: 1px solid rgba(160, 140, 110, 0.12);
    border-radius: 10px;
}

.history-container h3 {
    color: #5a4a38;
    margin-bottom: 15px;
    font-size: 1.15em;
    letter-spacing: 2px;
    font-family: 'Ma Shan Zheng', cursive;
    font-weight: normal;
}

#historyList {
    max-height: 200px;
    overflow-y: auto;
}

#historyList::-webkit-scrollbar {
    width: 4px;
}

#historyList::-webkit-scrollbar-track {
    background: transparent;
}

#historyList::-webkit-scrollbar-thumb {
    background: rgba(160, 140, 110, 0.25);
    border-radius: 4px;
}

.history-item {
    padding: 12px;
    border-bottom: 1px solid rgba(160, 140, 110, 0.1);
    font-size: 0.9em;
}

.history-item:last-child {
    border-bottom: none;
}

.history-time {
    color: #b0a090;
    font-size: 0.8em;
    margin-bottom: 5px;
}

.history-question {
    color: #4a3c2a;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.history-gua {
    font-weight: bold;
    color: #6a5a48;
    margin-bottom: 8px;
    font-family: 'Ma Shan Zheng', cursive;
    font-weight: normal;
    font-size: 1.05em;
}

.copy-btn {
    background: rgba(120, 100, 70, 0.08);
    color: #6a5a48;
    border: 1px solid rgba(160, 140, 110, 0.25);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.copy-btn:hover {
    background: rgba(120, 100, 70, 0.15);
}

.delete-btn {
    background: rgba(185, 92, 58, 0.06);
    color: #b85c3a;
    border: 1px solid rgba(185, 92, 58, 0.2);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.delete-btn:hover {
    background: rgba(185, 92, 58, 0.12);
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.footer-links {
    text-align: center;
    padding: 20px 0 10px;
    font-size: 0.8em;
}

.footer-links a {
    color: #a09080;
    text-decoration: none;
}

.footer-links a:hover {
    color: #7a6a58;
    text-decoration: underline;
}

/* ========== Login Overlay ========== */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(244, 240, 232, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
}

.login-overlay.show {
    display: flex;
    pointer-events: auto;
}

.login-container {
    background: rgba(255, 253, 248, 0.95);
    border: 1px solid rgba(160, 140, 110, 0.2);
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(100, 80, 60, 0.1);
}

.login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.login-header h2 {
    color: #4a3c2a;
    font-size: 1.4em;
    letter-spacing: 2px;
    font-family: 'Ma Shan Zheng', cursive;
    font-weight: normal;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: #b0a090;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: #6a5a48;
}

/* ========== Google Login ========== */

.google-login-container {
    text-align: center;
    padding: 20px 0;
}

.google-login-title {
    font-size: 1.1em;
    color: #8a7a68;
    margin-bottom: 20px;
}

.google-login-btn {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.8);
    color: #4a3c2a;
    border: 1px solid rgba(160, 140, 110, 0.25);
    border-radius: 10px;
    font-size: 1.05em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.google-login-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(160, 140, 110, 0.4);
    box-shadow: 0 2px 12px rgba(100, 80, 60, 0.08);
}

.google-icon {
    width: 22px;
    height: 22px;
}

.google-login-tip {
    margin-top: 15px;
    color: #b0a090;
    font-size: 0.85em;
}

.login-error {
    margin-top: 15px;
    padding: 12px;
    background: rgba(185, 92, 58, 0.08);
    color: #b85c3a;
    border: 1px solid rgba(185, 92, 58, 0.2);
    border-radius: 8px;
    text-align: center;
    display: none;
    font-size: 0.9em;
}

.login-error.show {
    display: block;
}

/* ========== User Info ========== */

.user-info {
    text-align: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    background: rgba(120, 100, 70, 0.08);
    border: 2px solid rgba(160, 140, 110, 0.25);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
    color: #5a4a38;
    font-size: 2em;
    font-weight: bold;
    font-family: 'Ma Shan Zheng', cursive;
}

.user-details {
    margin-bottom: 20px;
}

.user-nickname {
    font-size: 1.2em;
    color: #4a3c2a;
    font-weight: bold;
    margin-bottom: 5px;
}

.user-uid {
    font-size: 0.85em;
    color: #b0a090;
}

.user-xiayi {
    font-size: 0.85em;
    color: #6a5a48;
    margin-top: 2px;
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: rgba(185, 92, 58, 0.06);
    color: #b85c3a;
    border: 1px solid rgba(185, 92, 58, 0.2);
    border-radius: 10px;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.logout-btn:hover {
    background: rgba(185, 92, 58, 0.12);
}

/* ========== Forum Panel ========== */

.forum-panel {
    background: rgba(255, 253, 248, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(160, 140, 110, 0.2);
    border-radius: 12px;
    padding: 24px;
    width: 360px;
    min-width: 300px;
    flex-shrink: 1;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 4px 30px rgba(100, 80, 60, 0.08);
    position: sticky;
    top: 20px;
}

.forum-panel::-webkit-scrollbar {
    width: 4px;
}

.forum-panel::-webkit-scrollbar-track {
    background: transparent;
}

.forum-panel::-webkit-scrollbar-thumb {
    background: rgba(160, 140, 110, 0.2);
    border-radius: 4px;
}

.miao-panel {
    border-color: rgba(100, 160, 100, 0.2);
}

.miao-panel .forum-header h3 {
    color: #4a7a4a;
    border-bottom-color: rgba(100, 160, 100, 0.15);
}

.miao-panel .forum-post-title {
    color: #4a7a4a;
}

.miao-panel .forum-detail-title {
    color: #4a7a4a;
}

.forum-header h3 {
    color: #5a4a38;
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.4em;
    font-weight: normal;
    letter-spacing: 2px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(160, 140, 110, 0.12);
}

/* Forum Post List */
.forum-post-item {
    padding: 14px;
    border-bottom: 1px solid rgba(160, 140, 110, 0.08);
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 8px;
}

.forum-post-item:hover {
    background: rgba(240, 235, 225, 0.5);
}

.forum-post-title {
    color: #5a4a38;
    font-size: 0.95em;
    font-weight: bold;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.forum-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    color: #b0a090;
}

.forum-post-author {
    color: #8a7a68;
}

/* Forum Post Detail */
.forum-back-btn {
    background: none;
    border: none;
    color: #7a6a58;
    cursor: pointer;
    font-size: 0.9em;
    padding: 6px 0;
    margin-bottom: 12px;
    transition: color 0.3s;
    font-family: inherit;
}

.forum-back-btn:hover {
    color: #4a3c2a;
}

.forum-detail-title {
    color: #4a3c2a;
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 8px;
    line-height: 1.4;
}

.forum-detail-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85em;
    color: #a09888;
    margin-bottom: 16px;
}

.forum-detail-content {
    padding: 16px;
    background: rgba(240, 235, 225, 0.5);
    border-radius: 8px;
    border-left: 3px solid rgba(120, 100, 70, 0.3);
    margin-bottom: 20px;
    color: #4a3c2a;
    font-size: 0.9em;
    line-height: 1.8;
}

.forum-detail-content strong {
    color: #5a4a38;
    display: block;
    margin-bottom: 4px;
    margin-top: 10px;
    font-family: 'Ma Shan Zheng', cursive;
    font-weight: normal;
    letter-spacing: 2px;
}

.forum-detail-content strong:first-child {
    margin-top: 0;
}

/* Forum Comments */
.forum-comments-section h4 {
    color: #7a6a58;
    font-size: 0.95em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(160, 140, 110, 0.1);
}

.forum-comment-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(160, 140, 110, 0.06);
}

.forum-comment-item:last-child {
    border-bottom: none;
}

.forum-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.forum-comment-author {
    color: #7a6a58;
    font-size: 0.85em;
    font-weight: bold;
}

.forum-comment-time {
    color: #c0b0a0;
    font-size: 0.75em;
}

.forum-comment-delete {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(185, 92, 58, 0.5);
    font-size: 0.75em;
    cursor: pointer;
    transition: color 0.3s;
    font-family: inherit;
}

.forum-comment-delete:hover {
    color: #b85c3a;
}

.accept-btn {
    background: none;
    border: 1px solid rgba(120, 100, 70, 0.3);
    color: #6a5a48;
    font-size: 0.8em;
    font-family: 'Ma Shan Zheng', cursive;
    padding: 2px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: auto;
    letter-spacing: 1px;
}

.accept-btn:hover {
    background: rgba(120, 100, 70, 0.08);
}

.comment-accepted-mark {
    color: #4a7a4a;
    font-size: 0.75em;
    font-weight: bold;
    margin-left: auto;
}

.xiayi-badge {
    font-size: 0.7em;
    color: #a09888;
    margin-left: 4px;
}

.forum-comment-item.accepted {
    border-left: 2px solid rgba(74, 122, 74, 0.4);
    padding-left: 10px;
}

.forum-comment-text {
    color: #4a3c2a;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Comment Form */
#forumCommentInput,
#miaoCommentInput {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9em;
    border: 1px solid rgba(160, 140, 110, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.5);
    color: #3a3228;
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

#forumCommentInput:focus,
#miaoCommentInput:focus {
    outline: none;
    border-color: rgba(120, 100, 70, 0.4);
}

#forumCommentInput::placeholder,
#miaoCommentInput::placeholder {
    color: #b5a898;
}

.forum-comment-submit-btn {
    margin-top: 8px;
    padding: 8px 20px;
    background: rgba(120, 100, 70, 0.08);
    color: #5a4a38;
    border: 1px solid rgba(160, 140, 110, 0.25);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.forum-comment-submit-btn:hover {
    background: rgba(120, 100, 70, 0.15);
}

.forum-comment-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Forum Misc */
.forum-load-more {
    text-align: center;
    padding: 12px 0;
}

.forum-load-more-btn {
    background: rgba(120, 100, 70, 0.06);
    color: #8a7a68;
    border: 1px solid rgba(160, 140, 110, 0.2);
    border-radius: 6px;
    padding: 8px 24px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.forum-load-more-btn:hover {
    background: rgba(120, 100, 70, 0.12);
    color: #5a4a38;
}

.forum-empty {
    text-align: center;
    padding: 40px 20px;
    color: #b0a090;
    font-size: 0.9em;
}

.forum-login-hint {
    text-align: center;
    padding: 12px;
    color: #b0a090;
    font-size: 0.85em;
    font-style: italic;
}

/* Forward button in history */
.forward-btn {
    background: rgba(120, 100, 70, 0.08);
    color: #6a5a48;
    border: 1px solid rgba(160, 140, 110, 0.25);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.forward-btn:hover {
    background: rgba(120, 100, 70, 0.15);
}

.forward-btn.forwarded,
.forward-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Delete button in post detail */
.forum-delete-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(185, 92, 58, 0.5);
    font-size: 0.8em;
    cursor: pointer;
    transition: color 0.3s;
    padding: 2px 0;
    font-family: inherit;
}

.forum-delete-btn:hover {
    color: #b85c3a;
}

/* Mobile Tab Bar */
.mobile-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(160, 140, 110, 0.15);
    z-index: 100;
    padding: 8px 0;
    justify-content: center;
}

.mobile-tab {
    flex: 1;
    background: none;
    border: none;
    color: #b0a090;
    padding: 8px;
    cursor: pointer;
    text-align: center;
    transition: color 0.3s;
    font-family: inherit;
}

.mobile-tab.active {
    color: #5a4a38;
}

.tab-icon {
    display: block;
    font-size: 1.2em;
    margin-bottom: 2px;
}

.tab-label {
    font-size: 0.75em;
}

/* ========== Responsive ========== */

@media (max-width: 1200px) {
    .app-layout {
        flex-direction: column;
        align-items: center;
        padding-bottom: 70px;
    }

    .container {
        min-width: 0;
    }

    .forum-panel {
        width: 100%;
        max-width: 600px;
        position: static;
        max-height: none;
        display: none;
        min-width: 0;
    }

    .forum-panel.mobile-visible {
        display: block;
    }

    .container.mobile-hidden {
        display: none;
    }

    .mobile-tab-bar {
        display: flex;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .coins-container {
        gap: 15px;
    }

    .coin {
        width: 80px;
        height: 80px;
    }

    .gua-symbol {
        font-size: 2em;
    }
}
