:root {
    --bg-dark: #171410;
    --bg: #1f1915;
    --bg-light: #2b231d;
    --card: #332a23;
    --card-hover: #3d322a;
    --border: #4d4036;
    --border-light: #685849;
    --accent: #6f8f44;
    --accent-light: #8aad5e;
    --accent-dark: #526d31;
    --gold: #c9a03f;
    --gold-light: #e0b856;
    --blue: #5e8c9e;
    --blue-light: #7aa8b8;
    --purple: #9c7a4d;
    --purple-light: #c4a070;
    --green: #6e9e4f;
    --green-light: #8ec06c;
    --red: #b24a3f;
    --red-light: #d96f63;
    --text: #eaddcf;
    --text-muted: #a89a8b;
    --text-dim: #7a6e62;
    --shadow: 4px 4px 0 rgba(0,0,0,0.35);
    --shadow-lg: 6px 6px 0 rgba(0,0,0,0.45);
    --radius: 2px;
    --radius-sm: 2px;
    --radius-lg: 2px;
}

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

body {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    background-image:
        radial-gradient(ellipse at 10% 0%, rgba(201,160,63,0.06) 0%, transparent 45%),
        radial-gradient(ellipse at 90% 100%, rgba(111,143,68,0.05) 0%, transparent 45%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px);
}

/* ===== 登录页 ===== */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(201,160,63,0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 90%, rgba(111,143,68,0.06) 0%, transparent 40%),
        var(--bg-dark);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
}
.login-container {
    max-width: 420px;
    width: 100%;
    text-align: center;
}
.login-emblem {
    font-size: 80px;
    margin-bottom: 16px;
    filter: drop-shadow(4px 4px 0 rgba(0,0,0,0.4));
}
.login-emblem.pulse {
    animation: none;
}
@keyframes emblemPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(4px 4px 0 rgba(0,0,0,0.4)); }
    50% { transform: scale(1.05); filter: drop-shadow(6px 6px 0 rgba(0,0,0,0.45)); }
}
.login-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 8px;
    letter-spacing: -1px;
}
.login-subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 32px;
}
.login-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.login-card-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.login-card p {
    color: var(--text-muted);
    margin-bottom: 16px;
}
.cmd-box {
    display: inline-block;
    background: var(--accent-dark);
    color: var(--text);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--accent);
    font-family: 'Courier New', 'Noto Sans SC', monospace;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}
.login-status {
    color: var(--text-dim);
    font-size: 14px;
}
.loading-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 20px 0;
    overflow: hidden;
}
.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: loadingPulse 1.5s ease-in-out infinite;
}
@keyframes loadingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== 应用布局 ===== */
.app-layout { min-height: 100vh; }

/* ===== 顶部导航 ===== */
.topbar {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 64px;
    background: var(--bg);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
    box-shadow: 0 3px 0 rgba(0,0,0,0.25);
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}
.brand-icon {
    font-size: 24px;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.35));
}
.brand-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
}
.menu-toggle {
    display: none;
    background: var(--bg-light);
    border: 2px solid var(--border);
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}
.menu-toggle:hover { background: var(--card-hover); }
.nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
    flex-wrap: wrap;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-link:hover {
    background: var(--card-hover);
    color: var(--text);
    border-color: var(--border);
}
.nav-link.active {
    background: var(--accent-dark);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.nav-icon { font-size: 16px; }
.user-panel {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-balance {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-light);
    border: 2px solid var(--gold);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: var(--gold-light);
    font-weight: 600;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}
.balance-icon { font-size: 16px; }
.user-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-size: 14px;
}
.user-avatar {
    font-size: 18px;
}
.btn-logout {
    background: var(--card);
    border: 2px solid var(--border);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}
.btn-logout:hover {
    background: var(--red);
    border-color: var(--red);
    color: var(--text);
}

/* ===== 内容区 ===== */
.tab-content {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.page-header {
    margin-bottom: 24px;
}
.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}
.page-icon { font-size: 28px; }
.page-desc {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 14px;
}

/* ===== 仪表盘 ===== */
.dashboard-hero {
    margin-bottom: 28px;
}
.dashboard-hero h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}
.hero-subtitle {
    color: var(--text-muted);
    margin-top: 4px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--card);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.stat-card:hover {
    transform: translate(-2px,-2px);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.35);
}
.stat-card-gold::before { background: var(--gold); }
.stat-card-blue::before { background: var(--blue); }
.stat-card-purple::before { background: var(--purple); }
.stat-card-green::before { background: var(--green); }
.stat-card-icon {
    font-size: 40px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}
.stat-card-info {
    display: flex;
    flex-direction: column;
}
.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    font-family: 'Courier New', monospace;
}
.stat-unit {
    font-size: 12px;
    color: var(--text-dim);
}
.stat-card-gold .stat-value { color: var(--gold-light); }
.stat-card-blue .stat-value { color: var(--blue-light); }
.stat-card-purple .stat-value { color: var(--purple-light); }
.stat-card-green .stat-value { color: var(--green-light); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ===== 卡片 ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    overflow: hidden;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}
.card:hover { border-color: var(--border-light); }
.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border);
    background: rgba(0,0,0,0.12);
}
.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.card-icon { font-size: 20px; }
.card-body { padding: 20px; }

/* ===== 搜索栏 ===== */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--card);
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
}
.search-icon {
    font-size: 18px;
    color: var(--text-dim);
}
.search-bar input {
    flex: 1;
    min-width: 200px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 14px;
    outline: none;
}
.search-bar input::placeholder { color: var(--text-dim); }
.filter-group {
    display: flex;
    gap: 8px;
}
.filter-chip {
    cursor: pointer;
}
.filter-chip input { display: none; }
.filter-chip span {
    display: inline-block;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--text-muted);
    font-size: 13px;
    transition: all 0.2s;
    border: 2px solid transparent;
}
.filter-chip input:checked + span {
    background: var(--accent-dark);
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.action-bar { margin-bottom: 20px; }

/* ===== 按钮 ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent-dark);
    color: var(--text);
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: var(--shadow);
}
.btn-primary:hover {
    background: var(--accent);
    transform: translate(-2px,-2px);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.35);
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-light);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-secondary:hover {
    background: var(--card-hover);
    border-color: var(--border-light);
    transform: translate(-1px,-1px);
}
.btn-block { width: 100%; justify-content: center; }
.btn-with-icon { gap: 10px; }

/* ===== 物品网格 ===== */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.item-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}
.item-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    border: 2px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}
.item-card:hover {
    transform: translate(-2px,-2px);
    border-color: var(--accent);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.35);
}
.item-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent), var(--shadow);
}
.item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    image-rendering: pixelated;
    object-fit: contain;
    background: var(--bg-light);
    padding: 4px;
    border: 2px solid var(--border);
}
.item-icon-fallback {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    color: var(--text);
    background: var(--accent-dark);
    border: 2px solid var(--accent);
}
.item-name {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    color: var(--text);
}
.item-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.item-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    cursor: help;
    transition: transform 0.2s;
}
.item-badge:hover { transform: scale(1.2); }
.item-badge.enchant { background: rgba(156,122,77,0.18); border-color: var(--purple); }
.item-badge.damaged { background: rgba(201,160,63,0.18); border-color: var(--gold); }
.item-badge.unbreakable { background: rgba(94,140,158,0.18); border-color: var(--blue); }
.item-badge.custom { background: rgba(110,158,79,0.18); border-color: var(--green); }
.item-price {
    display: flex;
    gap: 16px;
    margin: 8px 0;
    font-size: 14px;
}
.price-buy { color: var(--green-light); font-weight: 600; font-family: 'Courier New', monospace; }
.price-sell { color: var(--red-light); font-weight: 600; font-family: 'Courier New', monospace; }
.item-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin: 4px 0;
}
.item-meta span { color: var(--text-muted); }
.item-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    align-items: center;
}
.item-actions input {
    width: 60px;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    text-align: center;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}
.item-actions input:focus { outline: none; border-color: var(--accent); }
.btn-buy, .btn-sell, .btn-cancel {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
}
.btn-buy {
    background: var(--green);
    color: var(--text);
    border: 2px solid var(--green-light);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.btn-buy:hover { background: var(--green-light); transform: translate(-1px,-1px); box-shadow: 4px 4px 0 rgba(0,0,0,0.25); }
.btn-sell {
    background: var(--red);
    color: var(--text);
    border: 2px solid var(--red-light);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.btn-sell:hover { background: var(--red-light); transform: translate(-1px,-1px); box-shadow: 4px 4px 0 rgba(0,0,0,0.25); }
.btn-cancel {
    background: var(--bg-light);
    color: var(--red-light);
    border: 2px solid var(--red);
}
.btn-cancel:hover { background: var(--red); color: var(--text); }
.trend-up { color: var(--green-light); }
.trend-down { color: var(--red-light); }
.trend-flat { color: var(--text-dim); }

/* ===== 聊天 ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    background: var(--card);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-msg {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    max-width: 75%;
    font-size: 14px;
    line-height: 1.5;
    animation: msgIn 0.2s ease;
    border: 2px solid var(--border);
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-msg.other {
    background: var(--bg-light);
    align-self: flex-start;
    border-bottom-left-radius: var(--radius-sm);
}
.chat-msg.self {
    background: var(--accent-dark);
    color: var(--text);
    align-self: flex-end;
    border-bottom-right-radius: var(--radius-sm);
    border-color: var(--accent);
}
.chat-time {
    font-size: 11px;
    color: var(--text-dim);
    margin-right: 8px;
}
.chat-msg.self .chat-time { color: var(--text-muted); }
.chat-name { font-weight: 600; margin-right: 6px; }
.chat-tag {
    display: inline-block;
    font-size: 10px;
    background: var(--gold);
    color: var(--bg-dark);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: 6px;
    font-weight: 600;
}
.chat-input-bar {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-light);
    border-top: 2px solid var(--border);
}
.chat-input-bar input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.chat-input-bar input:focus { border-color: var(--accent); }

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    transition: all 0.2s;
}
.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(111,143,68,0.15);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-result {
    margin-top: 12px;
    font-size: 14px;
    min-height: 20px;
}
.form-result.success { color: var(--green-light); }
.form-result.error { color: var(--red-light); }

/* ===== 银行 ===== */
.bank-container {
    max-width: 500px;
}
.bank-card .card-header {
    background: rgba(201,160,63,0.08);
}

/* ===== 管理面板 ===== */
.manage-section {
    background: var(--card);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.manage-section h3 {
    padding: 16px 20px;
    background: rgba(0,0,0,0.12);
    border-bottom: 2px solid var(--border);
    font-size: 15px;
    color: var(--gold-light);
}
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(77,64,54,0.6);
    gap: 16px;
}
.setting-row:last-child { border-bottom: none; }
.setting-row label {
    color: var(--text);
    font-size: 14px;
    flex: 1;
}
.setting-row input[type="number"], .setting-row input[type="text"] {
    width: 160px;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
.setting-row input:focus {
    outline: none;
    border-color: var(--accent);
}
.setting-row select {
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
.range-controls { display: flex; align-items: center; gap: 12px; flex: 1; }

/* ===== 开关 ===== */
.toggle {
    position: relative;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 18px;
    transition: 0.3s;
}
.toggle .slider:before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--text);
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .slider { background: var(--green); }
.toggle input:checked + .slider:before { transform: translateX(16px); }

/* ===== 数值滑块 ===== */
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
}
.range-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.range-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}
.range-value { min-width: 60px; text-align: right; font-weight: 600; color: var(--text); font-family: 'Courier New', monospace; }

/* ===== 子Tab ===== */
.sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
}
.sub-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.sub-tab:hover { color: var(--text); }
.sub-tab.active { color: var(--gold-light); border-bottom-color: var(--gold); }
.sub-tab-content { display: block; }

/* ===== 国库余额 ===== */
.treasury-balance {
    font-size: 24px;
    font-weight: 800;
    color: var(--gold);
    margin: 8px 0;
    font-family: 'Courier New', monospace;
}
.hint-inline { font-size: 11px; color: var(--text-muted); font-weight: 400; }

/* ===== 地图 ===== */
.map-wrapper { display: flex; flex-direction: column; gap: 16px; }
.map-open-btn { align-self: flex-start; }

/* ===== 日志筛选栏 ===== */
.log-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}
.log-filter-bar select, .log-filter-bar input {
    padding: 8px 12px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 13px;
}
.log-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}
.log-pagination button {
    padding: 8px 16px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}
.log-pagination button:hover:not(:disabled) {
    background: var(--accent-dark);
    color: var(--text);
    border-color: var(--accent);
}
.log-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.page-info, .log-page-info { color: var(--text-muted); font-size: 13px; }

/* ===== 详情弹窗内容 ===== */
.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.detail-info-item {
    background: var(--bg-light);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}
.detail-info-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.detail-info-value { font-size: 16px; font-weight: 600; color: var(--text); }
.detail-members-list {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: 8px;
    border: 2px solid var(--border);
}
.detail-member-item {
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius-sm);
}
.detail-member-item:hover { background: var(--card-hover); }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.detail-item {
    background: var(--bg-light);
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
}
.detail-label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.detail-value { font-size: 15px; font-weight: 600; color: var(--text); }
.detail-section { margin-bottom: 16px; }
.detail-section h4 { font-size: 15px; margin-bottom: 8px; color: var(--gold-light); }
.detail-section p { color: var(--text-muted); }
.detail-item-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}
.detail-sub { font-size: 12px; color: var(--text-dim); }
.link { color: var(--accent-light); text-decoration: underline; }
.link:hover { color: var(--gold-light); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* ===== 日志列表 ===== */
.log-item {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(77,64,54,0.6);
    font-size: 13px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.log-item:last-child { border-bottom: none; }
.log-time { color: var(--text-dim); }
.log-player { color: var(--green-light); font-weight: 600; }
.log-action { color: var(--gold-light); }
.log-location, .log-detail { color: var(--text-dim); font-size: 12px; }

/* ===== 弹窗 ===== */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.75);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    background: var(--card);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    border: 2px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}
.modal-small { max-width: 400px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid var(--border);
    background: rgba(0,0,0,0.12);
}
.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gold-light);
}
.modal-close {
    background: var(--bg-light);
    border: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.modal-close:hover {
    background: var(--card-hover);
    color: var(--text);
    border-color: var(--border-light);
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 2px solid var(--border);
    background: rgba(0,0,0,0.12);
}
.modal-footer button { flex: 1; }

/* ===== Toast提示 ===== */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--green);
    color: var(--text);
    border-radius: var(--radius);
    display: none;
    z-index: 300;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--green-light);
}
.toast.error {
    background: var(--red);
    border-left-color: var(--red-light);
}
.toast.show {
    display: block;
    animation: toastIn 0.3s ease;
}
@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== 骨架屏加载 ===== */
.skeleton-loader {
    background: linear-gradient(90deg, var(--bg-light) 25%, var(--card-hover) 50%, var(--bg-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
    height: 20px;
    margin: 8px 0;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== 提示文字 ===== */
.hint {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 8px;
}

/* ===== 服务器统计 ===== */
.server-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.server-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 14px;
}
.server-stat b { color: var(--text); font-family: 'Courier New', monospace; }
.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.stat-dot.online {
    background: var(--green);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== 城镇卡片 ===== */
.town-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    margin-bottom: 8px;
    transition: all 0.2s;
}
.town-item:hover {
    background: var(--card-hover);
}
.town-icon { font-size: 20px; }
.town-name { flex: 1; color: var(--text); font-weight: 500; }
.town-nation {
    font-size: 12px;
    color: var(--text-dim);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.town-card {
    margin-bottom: 12px;
    transition: all 0.2s;
}
.town-card:hover {
    transform: translate(-2px,-2px);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.35);
}
.town-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 2px solid var(--border);
}
.town-card-icon { font-size: 24px; }
.town-card-name { flex: 1; font-size: 16px; font-weight: 600; color: var(--text); }
.town-card-nation {
    font-size: 12px;
    color: var(--purple-light);
    background: rgba(156,122,77,0.12);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--purple);
}
.town-card-body {
    display: flex;
    gap: 20px;
    padding: 16px 20px;
}
.town-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.town-stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
}
.town-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    font-family: 'Courier New', monospace;
}

/* ===== 空状态 ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-dim);
}
.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}
.empty-state p {
    font-size: 14px;
}

/* ===== NBT信息 ===== */
.nbt-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}
.nbt-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
}
.nbt-tag-enchant {
    background: rgba(156,122,77,0.14);
    color: var(--purple-light);
    border: 1px solid var(--purple);
}
.nbt-tag-damage {
    background: rgba(201,160,63,0.14);
    color: var(--gold-light);
    border: 1px solid var(--gold);
}
.nbt-tag-unbreakable {
    background: rgba(94,140,158,0.14);
    color: var(--blue-light);
    border: 1px solid var(--blue);
}
.nbt-tag-custom {
    background: rgba(110,158,79,0.14);
    color: var(--green-light);
    border: 1px solid var(--green);
}

/* ===== 按钮小 ===== */
.btn-small {
    padding: 6px 14px;
    background: var(--accent-dark);
    color: var(--text);
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.btn-small:hover {
    background: var(--accent);
    transform: translate(-1px,-1px);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.25);
}

/* ===== 趋势徽章 ===== */
.trend-badge {
    font-size: 14px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    border: 1px solid var(--border);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 12px;
        border-bottom: 2px solid var(--border);
        box-shadow: var(--shadow);
    }
    .nav-links.open { display: flex; }
    .nav-text { display: inline; }
    .user-panel { gap: 8px; }
    .user-name { display: none; }
    .user-balance { padding: 4px 10px; font-size: 12px; }
    .tab-content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .item-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .town-card-body { flex-wrap: wrap; gap: 12px; }
    .server-stats { gap: 12px; }
    .detail-grid, .detail-info-grid { grid-template-columns: 1fr; }
}
