:root {
    --primary: #2c1810;
    --primary-light: #4a3228;
    --accent: #c8946a;
    --accent-light: #e8d5c0;
    --bg: #f7f4f0;
    --card: #ffffff;
    --text: #1a1a1a;
    --text-light: #8a7e78;
    --text-muted: #b8aea8;
    --shadow: 0 2px 16px rgba(44, 24, 16, 0.06);
    --shadow-hover: 0 8px 32px rgba(44, 24, 16, 0.10);
    --radius: 14px;
    --radius-sm: 10px;
    --max-width: 480px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.app {
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--bg);
    min-height: 100vh;
    position: relative;
    padding-bottom: 20px;
}

/* ===== 顶部导航 ===== */
.header {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px 10px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header .top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header .logo {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.header .logo span { color: var(--accent); }
.header .logo .sub { font-size: 10px; font-weight: 400; opacity: 0.5; letter-spacing: 1px; }
.header .right { display: flex; align-items: center; gap: 6px; position: relative; }

.header .role-btn {
    background: rgba(255, 255, 255, 0.10);
    border: none;
    color: #fff;
    font-size: 12px;
    padding: 4px 12px 4px 14px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.2s;
    font-weight: 500;
}
.header .role-btn:active { background: rgba(255, 255, 255, 0.20); }
.header .role-btn .arrow { font-size: 8px; transition: transform 0.3s; }
.header .role-btn .arrow.open { transform: rotate(180deg); }

.header .icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.header .icon-btn:active { background: rgba(255, 255, 255, 0.18); }

/* ===== 角色下拉 ===== */
.role-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #fff;
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    min-width: 150px;
    overflow: hidden;
    z-index: 60;
}
.role-dropdown.open { display: block; animation: fadeDown 0.2s ease; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.role-dropdown .item {
    padding: 10px 18px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.role-dropdown .item:hover { background: #f5f0eb; }
.role-dropdown .item.active { background: #f0ebe6; color: var(--primary); font-weight: 500; }
.role-dropdown .item .badge { font-size: 9px; background: #f0ebe6; padding: 1px 10px; border-radius: 10px; color: var(--text-light); margin-left: auto; }

/* ===== 状态条 ===== */
.status-bar {
    display: flex;
    justify-content: flex-end;
    padding: 4px 16px 8px;
    font-size: 11px;
    color: var(--text-light);
    border-bottom: 1px solid #ebe5e0;
}

/* ===== Toast ===== */
.toast-float {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 24, 16, 0.92);
    color: #fff;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 999;
    max-width: 90%;
    text-align: center;
    backdrop-filter: blur(8px);
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: toastIn 0.3s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ===== 底部导航 ===== */
.bottom-nav {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 10px 16px 6px;
    border-top: 1px solid #f0ebe6;
    background: var(--bg);
    position: sticky;
    bottom: 0;
    z-index: 40;
}
.bottom-nav .nav-item {
    background: none;
    border: none;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    font-weight: 500;
    transition: color 0.2s;
}
.bottom-nav .nav-item .icon { font-size: 18px; }
.bottom-nav .nav-item .label { font-size: 10px; }
.bottom-nav .nav-item.active { color: var(--primary); font-weight: 600; }

/* ===== 响应式 ===== */
@media (max-width: 400px) {
    .header .logo { font-size: 16px; }
    .bottom-nav { gap: 20px; }
}
@media (min-width: 500px) {
    .app { border-radius: 20px; margin: 16px auto; min-height: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.04); }
}