/* ============================================================
   CSS 变量 —— 统一设计令牌
   ============================================================ */
:root {
    /* 颜色 */
    --bg-page: #f5f0e8;
    --bg-card: #fffdf7;
    --bg-input: #fdfcf9;
    --bg-hover: #fdfaf5;
    --bg-active: #fef9f0;
    --border: #e5ddd0;
    --border-light: #f0ebe0;
    --text-primary: #3d3226;
    --text-secondary: #6b5e4f;
    --text-muted: #9b8b7a;
    --gold: #c8a45c;
    --gold-light: #e8d5a3;
    --gold-dark: #9e7d3c;
    --red: #b5343a;
    --red-dark: #9a2d32;
    --red-light: #e8c9c9;
    --jade: #5a8a6a;
    --jade-dark: #4ba365;
    --blue: #4a6fa5;
    --blue-light: #e6edf8;
    --bg-subsection: #faf6ed;      /* 内容区背景（暖米色，比卡片深） */
    --accordion-title: #8a7a6a;    /* 标题文字颜色（灰褐色，突出但不刺眼） */
    --shadow-sm: 0 2px 8px rgba(61, 50, 38, 0.04);
    --shadow-md: 0 4px 16px rgba(61, 50, 38, 0.08);
    --shadow-lg: 0 6px 24px rgba(61, 50, 38, 0.10);
    --shadow-xl: 0 25px 60px rgba(61, 50, 38, 0.25);

    /* 间距 */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 18px;
    --radius-2xl: 24px;

    /* 字体 */
    --font-base: 15px;
    --font-family: 'Inter', 'Noto Serif SC', sans-serif;
    --font-xs: 0.65rem;
    --font-sm: 0.75rem;
    --font-md: 0.85rem;
    --font-lg: 1.1rem;
    --font-xl: 1.3rem;
    --font-2xl: 1.5rem;

    /* 三国主题色 */
    /* ★ 魏国（红色系） */
    --wei-bg: #fce8e8;
    --wei-text: #b5343a;
    --wei-border: #b5343a;
    /* ★ 蜀国（蓝色系） */
    --shu-bg: #e6edf8;
    --shu-text: #4a6fa5;
    --shu-border: #4a6fa5;
    /* ★ 吴国（黄色系） */
    --wu-bg: #fdf4d8;
    --wu-text: #b8860b;
    --wu-border: #b8860b;
    /* ★ 中立（灰色系） */
    --zhongli-bg: #f0ede8;
    --zhongli-text: #6b5e4f;
    --zhongli-border: #999999;
    /* ★ 南蛮（绿色系） */
    --nanman-bg: #e8f5e9;
    --nanman-text: #2e7d32;
    --nanman-border: #2e7d32;
    
    /* ★ 辽东（暗黄色系） */
    --liaodong-bg: #f5f0e0;
    --liaodong-text: #8d7a3a;
    --liaodong-border: #8d7a3a;

    /* 三国币金额分段颜色 */
    --coin-low-color: #3d3226;          /* 小于 1 万（文本色） */
    --coin-blue-color: #2a5c8a;         /* 1 万 ~ 10 万 */
    --coin-green-color: #2d7d46;        /* 10 万 ~ 100 万 */
    --coin-orange-color: #e68a2e;       /* 100 万 ~ 1000 万 */
    --coin-pink-color: #e84c8a;         /* 1000 万 ~ 1 亿 */
    --coin-red-color: #dc3545;          /* >= 1 亿 */
    --coin-negative-color: #b5343a;     /* 负数（红色） */

    /* 装备品质颜色 */
    /* 黄色 */
    --quality-basic-bg: #fef9e7;
    --quality-basic-text: #8b6914;
    --quality-basic-border: #d4a017;

    /* 橙色 */
    --quality-advanced-bg: #fff3e0;
    --quality-advanced-text: #b85e00;
    --quality-advanced-border: #ff8c00;

    /* 红色 */
    --quality-epic-bg: #fde8ec;
    --quality-epic-text: #9c0a22;
    --quality-epic-border: #dc143c;
    /* 稀有度颜色 */
    /* 绿色*/
    --soul-green-bg: #e8f5e9;
    --soul-green-text: #2e7d32;
    --soul-green-border: #2e7d32;

    /* 蓝色*/
    --soul-blue-bg: #e3f2fd;
    --soul-blue-text: #1565c0;
    --soul-blue-border: #1565c0;

    /* 紫色*/
    --soul-purple-bg: #f3e5f5;
    --soul-purple-text: #7b1fa2;
    --soul-purple-border: #7b1fa2;
/* ============================================================
   Tooltip 标准化模块
   ============================================================ */
    --tooltip-bg: var(--bg-card);
    --tooltip-shadow: var(--shadow-lg);
    --tooltip-border: var(--border);
    --tooltip-radius: var(--radius-lg);
    --tooltip-font-size: var(--font-sm);
    --tooltip-max-width: 320px;
    --tooltip-min-width: 220px;
    --tooltip-z-index: 99999;

    /* 过渡 */
    --transition: 0.25s ease;
    --btn-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ============================================================
   基础重置 & 全局
   ============================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    background: linear-gradient(180deg, #f9f6ef 0%, #f0ebe0 30%, var(--bg-page) 100%);
    background-attachment: fixed;
    font-family: var(--font-family);
    color: var(--text-primary);
    min-height: 100vh;
    font-size: var(--font-base);
    line-height: 1.5;
}
.main-container {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

/* ============================================================
   卡片（统一）
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition), transform 0.2s ease;
    max-width: 100%;
    overflow: hidden;
}
.card:hover {
    box-shadow: var(--shadow-lg);
}
.card-sm {
    border-radius: var(--radius-lg);
    padding: var(--space-md);
}
.card-md {
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
}
.card-lg {
    border-radius: var(--radius-2xl);
    padding: var(--space-xl);
}

/* 兼容旧类名 */
.card-elegant {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition), transform 0.2s ease;
    max-width: 100%;
    overflow: hidden;
}
.card-elegant:hover {
    box-shadow: var(--shadow-lg);
}

/* ============================================================
   顶部标签（Tab）
   ============================================================ */
.tab-main {
    font-size: var(--font-base);
    padding: 0.8rem 1.8rem;
    transition: all var(--transition);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    cursor: pointer;
}
.tab-main.active {
    background: linear-gradient(180deg, var(--bg-card) 0%, #faf6ed 100%);
    color: var(--gold);
    border-bottom-color: var(--gold);
    font-weight: 700;
}
.tab-main.hidden-tab {
    display: none;
}
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-page);
    padding-top: var(--space-sm);
}
.header-tabs {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-wrap: wrap;
}
.header-tabs .spacer {
    flex: 1;
}

/* ============================================================
   分类菜单标签（统一）
   ============================================================ */
.tab-btn {
    font-size: var(--font-md);
    padding: 0.4rem 1.2rem;
    border-radius: var(--radius-2xl);
    font-weight: 500;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition);
}
.tab-btn:hover {
    border-color: var(--gold);
    background: var(--bg-hover);
    color: var(--text-primary);
}
.tab-btn.active {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: #fff;
    border-color: var(--red);
    box-shadow: 0 4px 12px rgba(181, 52, 58, 0.25);
}
.tab-btn-sm {
    font-size: var(--font-sm);
    padding: 0.3rem 0.9rem;
}
.tab-btn-lg {
    font-size: var(--font-lg);
    padding: 0.5rem 1.5rem;
}

/* 兼容旧类名 */
.cat-tab-btn,
.item-cat-tab,
.lucky-cat-tab,
.material-type-filter {
    font-size: var(--font-md);
    padding: 0.4rem 1.2rem;
    border-radius: var(--radius-2xl);
    font-weight: 500;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition);
}
.cat-tab-btn:hover,
.item-cat-tab:hover,
.lucky-cat-tab:hover,
.material-type-filter:hover {
    border-color: var(--gold);
    background: var(--bg-hover);
    color: var(--text-primary);
}
.cat-tab-btn.active,
.item-cat-tab.active,
.lucky-cat-tab.active,
.material-type-filter.active {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: #fff;
    border-color: var(--red);
    box-shadow: 0 4px 12px rgba(181, 52, 58, 0.25);
}
.cat-tab-wrapper {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 0;
}
.cat-tab-wrapper .spacer {
    flex: 1;
    min-width: 8px;
}

/* 管理页子标签 */
.m-tab {
    padding: 0.6rem 1.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.m-tab:hover {
    background: rgba(200, 164, 92, 0.08);
    color: var(--text-primary);
    transform: translateY(-1px);
}
.m-tab.active {
    color: var(--gold);
    background: linear-gradient(180deg, rgba(200, 164, 92, 0.08) 0%, transparent 100%);
    font-weight: 700;
}
.m-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1.5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gold);
    border-radius: 3px 3px 0 0;
}
.m-tab .tab-icon {
    font-size: var(--font-lg);
    line-height: 1;
}
.manage-subtab-sticky {
    position: sticky;
    z-index: 45;
    background: var(--bg-card);
    border-bottom: 1.5px solid var(--border);
    padding: 0.25rem 0.25rem 0 0.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* 更多分类标签 */
.more-cat-tab,
.more-manage-cat-tab {
    font-size: 0.8rem;
    padding: 0.3rem 1rem;
    border-radius: var(--radius-2xl);
    font-weight: 500;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition);
}
.more-cat-tab:hover,
.more-manage-cat-tab:hover {
    border-color: var(--gold);
    background: var(--bg-hover);
    color: var(--text-primary);
}
.more-cat-tab.active,
.more-manage-cat-tab.active {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: #fff;
    border-color: var(--red);
    box-shadow: 0 4px 12px rgba(181, 52, 58, 0.25);
}
.more-cat-wrapper,
.more-manage-cat-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 6px 0 12px 0;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 16px;
}

/* ============================================================
   搜索框
   ============================================================ */
.search-input {
    font-size: var(--font-md);
    padding: 0.4rem 1.2rem 0.4rem 1.8rem;
    border-radius: var(--radius-2xl);
    border: 1.5px solid var(--border);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
    background-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
}
.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}
.search-input:hover,
.search-input:focus {
    border-color: var(--gold);
    background-color: var(--bg-hover);
}
.search-input:focus {
    box-shadow: 0 0 0 4px rgba(200, 164, 92, 0.12);
    background-color: #fffbf5;
}
.search-input-sm {
    font-size: var(--font-sm);
    padding: 0.3rem 0.9rem 0.3rem 1.6rem;
    background-size: 12px;
    background-position: 8px center;
}

/* 兼容旧 ID */
#global-search,
#item-search,
#material-search,
#item-manage-search,
#skill-search,
#shop-search,
#dungeon-search,
#lucky-search,
#more-activity-search,
#more-quiz-search {
    font-size: var(--font-md);
    padding: 0.4rem 1.2rem 0.4rem 1.8rem;
    border-radius: var(--radius-2xl);
    border: 1.5px solid var(--border);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
    background-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
}
#global-search::placeholder,
#item-search::placeholder,
#material-search::placeholder,
#item-manage-search::placeholder,
#skill-search::placeholder,
#shop-search::placeholder,
#dungeon-search::placeholder,
#lucky-search::placeholder,
#more-activity-search::placeholder,
#more-quiz-search::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}
#global-search:hover,
#item-search:hover,
#material-search:hover,
#item-manage-search:hover,
#skill-search:hover,
#shop-search:hover,
#dungeon-search:hover,
#lucky-search:hover,
#more-activity-search:hover,
#more-quiz-search:hover,
#global-search:focus,
#item-search:focus,
#material-search:focus,
#item-manage-search:focus,
#skill-search:focus,
#shop-search:focus,
#dungeon-search:focus,
#lucky-search:focus,
#more-activity-search:focus,
#more-quiz-search:focus {
    border-color: var(--gold);
    background-color: var(--bg-hover);
}
#global-search:focus,
#item-search:focus,
#material-search:focus,
#item-manage-search:focus,
#skill-search:focus,
#shop-search:focus,
#dungeon-search:focus,
#lucky-search:focus,
#more-activity-search:focus,
#more-quiz-search:focus {
    box-shadow: 0 0 0 4px rgba(200, 164, 92, 0.12);
    background-color: #fffbf5;
}

/* ============================================================
   登录按钮
   ============================================================ */
.login-btn {
    font-size: var(--font-base);
    padding: var(--space-sm) 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.login-btn:hover {
    border-color: var(--gold);
    background: var(--bg-hover);
}
.login-btn.logged-in {
    border-color: var(--jade);
    color: var(--jade);
    background: rgba(90, 138, 106, 0.06);
}
.login-btn.logged-in:hover {
    background: rgba(90, 138, 106, 0.12);
}
.login-btn .badge-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--jade);
    margin-right: 6px;
}

/* ============================================================
   按钮（统一系统）
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    border: 1.5px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: var(--font-base);
    height: 44px;
    padding: 0 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
    line-height: 1;
    position: relative;
}
.btn:active {
    transform: scale(0.96);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 尺寸 */
.btn-sm {
    height: 34px;
    padding: 0 12px;
    font-size: var(--font-sm);
}
.btn-lg {
    height: 52px;
    padding: 0 28px;
    font-size: var(--font-lg);
}
.btn-square {
    width: 44px;
    padding: 0;
}
.btn-square.btn-sm {
    width: 34px;
}
.btn-square.btn-lg {
    width: 52px;
}
.btn-block {
    width: 100%;
    justify-content: center;
}

/* 颜色变体 */

.btn-primary {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
    color: #fff;
    border-radius: var(--radius-md);
    border-color: var(--red);
    font-weight: 600;
    border: none;
    cursor: pointer;
    padding: 0.6rem 1.5rem;
    box-shadow: 0 4px 10px rgba(181, 52, 58, 0.2);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    font-family: var(--font-family);
    font-size: var(--font-base);
}

.btn-primary:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    box-shadow: 0 4px 14px rgba(181, 52, 58, 0.3);
    transform: translateY(-1px);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(200, 164, 92, 0.3);
}
.btn-gold:hover {
    background: linear-gradient(135deg, #d4b06a 0%, #ae8a3c 100%);
    box-shadow: 0 4px 12px rgba(200, 164, 92, 0.35);
    transform: translateY(-1px);
}

.btn-outline {
    background: #fff;
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-outline:hover {
    border-color: var(--gold);
    background: var(--bg-hover);
    transform: none; /* 或 translateY(-0.5px) */
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover {
    background: var(--bg-hover);
}

.btn-edit {
    background: transparent;
    color: var(--blue);
    border-color: transparent;
}
.btn-edit:hover {
    background: rgba(74, 111, 165, 0.12);
}

.btn-del {
    background: transparent;
    color: #c0392b;
    border-color: transparent;
}
.btn-del:hover {
    background: rgba(192, 57, 43, 0.12);
}

.btn-wei {
    background: var(--wei-text);
    color: #fff;
    border-color: var(--wei-text);
    box-shadow: 0 2px 8px rgba(181, 52, 58, 0.15);
}
.btn-wei:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    box-shadow: 0 3px 12px rgba(181, 52, 58, 0.3);
    transform: translateY(-1px);
}
.btn-wei.inactive {
    background: #fff;
    color: var(--wei-text);
    border-color: var(--wei-text);
    box-shadow: none;
}
.btn-wei.inactive:hover {
    background: rgba(181, 52, 58, 0.08);
}
.btn-wei.active {
    background: var(--wei-text);
    color: #fff;
    border-color: var(--wei-text);
    box-shadow: 0 2px 8px rgba(181, 52, 58, 0.25);
}
.btn-wei.active:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    box-shadow: 0 4px 20px rgba(181, 52, 58, 0.45);
}

.btn-outline {
    background: #fff;
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: var(--font-base);
    transition: all var(--transition);
}
.btn-ghost {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: var(--font-md);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 500;
    transition: background var(--transition);
    font-family: var(--font-family);
}
.btn-ghost.edit {
    color: var(--blue);
    background: rgba(74, 111, 165, 0.06);
}
.btn-ghost.edit:hover {
    background: rgba(74, 111, 165, 0.15);
}
.btn-ghost.del {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.06);
}
.btn-ghost.del:hover {
    background: rgba(192, 57, 43, 0.15);
}
.price-sync-btn {
    font-size: var(--font-sm);
    padding: 0.2rem 0.8rem;
    margin-left: var(--space-sm);
}

.btn-char-action {
    background: var(--wei-text);
    color: #ffffff;
    border: 1.5px solid var(--wei-text);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 12px;
    height: 44px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(181, 52, 58, 0.15);
    font-family: var(--font-family);
    white-space: nowrap;
    width: auto;
    min-width: 60px;
}
.btn-char-action:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    box-shadow: 0 4px 16px rgba(181, 52, 58, 0.35);
    transform: translateY(-2px) scale(1.02);
}
.btn-char-action:active {
    transform: scale(0.96);
}
#char-ascend-btn {
    width: 100%;
}
#char-leader-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    min-width: 44px;
}
.btn-char-action.inactive {
    background: #ffffff;
    color: var(--wei-text);
    border-color: var(--wei-text);
    box-shadow: none;
}
.btn-char-action.inactive:hover {
    background: rgba(181, 52, 58, 0.08);
}
.btn-char-action.active {
    background: var(--wei-text);
    color: #ffffff;
    border-color: var(--wei-text);
    box-shadow: 0 2px 8px rgba(181, 52, 58, 0.25);
}
.btn-char-action.active:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    box-shadow: 0 4px 20px rgba(181, 52, 58, 0.45);
}

/* 福利按钮（特殊圆形） */
.task-fav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    background: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
    user-select: none;
    color: #999;
}
.task-fav-btn:hover {
    transform: scale(1.08);
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(200, 164, 92, 0.2);
}
.task-fav-btn.active {
    border-color: #b5343a;
    background: rgba(181, 52, 58, 0.5);
    color: #b5343a;
    box-shadow: 0 0 12px rgba(181, 52, 58, 0.25);
}
.task-fav-btn:active {
    transform: scale(0.92);
}

/* ============================================================
   道具列表项
   ============================================================ */
.item-row-el {
    font-size: var(--font-base);
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.35s ease;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.item-row-el:hover {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--bg-hover) 0%, #f8f0e4 100%);
    box-shadow: 0 4px 16px rgba(200, 164, 92, 0.25);
    transform: translateY(-1px);
}
.item-row-el.selected {
    background: linear-gradient(135deg, #fef9f0 0%, #fdf4e2 100%);
    border-color: var(--gold);
    box-shadow: 0 4px 16px rgba(200, 164, 92, 0.25);
    font-weight: 600;
}
.item-list-scroll {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding-right: 2px;
}

/* ============================================================
   图标
   ============================================================ */
.item-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.item-icon-sm {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}
.item-icon-xs {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 2px;
    flex-shrink: 0;
}
.td-name-with-icon,
.cell-name-with-icon,
.detail-title-with-icon,
.profit-item-name-with-icon,
.synth-target-name {
    display: flex;
    align-items: center;
    gap: 6px;
}
.td-name-with-icon img,
.cell-name-with-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 3px;
}
.detail-title-with-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}
.profit-item-name-with-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 2px;
    background: var(--bg-page);
}
.synth-target-name img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 2px;
}

/* ============================================================
   国家标签（统一）
   ============================================================ */
.country-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    line-height: 1.8;
    flex-shrink: 0;
}
.country-tag.country-魏 {
    background: var(--wei-bg);
    color: var(--wei-text);
    border-color: var(--wei-border);
}
.country-tag.country-蜀 {
    background: var(--shu-bg);
    color: var(--shu-text);
    border-color: var(--shu-border);
}
.country-tag.country-吴 {
    background: var(--wu-bg);
    color: var(--wu-text);
    border-color: var(--wu-border);
}
.country-tag.country-中立 {
    background: var(--zhongli-bg);
    color: var(--zhongli-text);
    border-color: var(--zhongli-border);
}

/* ============================================================
   表格（统一风格）
   ============================================================ */
.table-elegant {
    width: 100%;
    border-collapse: collapse;
}
.table-elegant th {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.8rem 0.5rem;
    text-align: left;
}
.table-elegant td {
    font-size: 0.8rem;
    padding: 0.5rem 0.2rem;
    text-align: left;
}
.table-elegant tbody tr {
    transition: background 0.15s;
    border-bottom: 1px solid #f2efe7;
}
.table-elegant tbody tr:hover {
    background: rgba(200, 164, 92, 0.04);
}
.table-elegant tbody tr:last-child {
    border-bottom: none;
}

/* ============================================================
   输入框 & 选择框
   ============================================================ */
input[type="number"],
input[type="text"],
input[type="search"],
select,
textarea {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    font-size: var(--font-base);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: var(--font-family);
    color: var(--text-primary);
    /* width: 100%; */
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(200, 164, 92, 0.12);
    outline: none;
}
input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}
select {
    appearance: auto;
    cursor: pointer;
}
select option {
    padding: 4px 8px;
}

/* ============================================================
   徽章
   ============================================================ */
.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-2xl);
    font-size: var(--font-sm);
    font-weight: 600;
}
.badge-gold {
    background: rgba(200, 164, 92, 0.15);
    color: var(--gold-dark);
    border: 1px solid rgba(200, 164, 92, 0.2);
}
.badge-lucky {
    background: rgba(74, 111, 165, 0.12);
    color: var(--blue);
    border: 1px solid rgba(74, 111, 165, 0.15);
}
.badge-red {
    background: rgba(181, 52, 58, 0.12);
    color: var(--red);
    border: 1px solid rgba(181, 52, 58, 0.15);
}
.badge-jade {
    background: rgba(90, 138, 106, 0.12);
    color: var(--jade-dark);
    border: 1px solid rgba(90, 138, 106, 0.15);
}

/* ============================================================
   布局：计算页网格
   ============================================================ */
.calc-grid-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
@media (min-width: 1024px) {
    .calc-grid-wrapper {
        flex-direction: row;
        align-items: stretch;
    }
    .calc-grid-wrapper .left-card {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        min-height: 400px;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }
    .calc-grid-wrapper .right-card {
        flex: 1;
        min-height: 400px;
        display: flex;
        flex-direction: column;
    }
    .calc-grid-wrapper .left-card .item-list-scroll {
        flex: 1 1 0;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
        padding-right: 2px;
    }
    .calc-grid-wrapper .right-card #calc-detail-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
    .calc-grid-wrapper .right-card #calc-detail {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
}
@media (max-width: 1023px) {
    .calc-grid-wrapper .left-card .item-list-scroll {
        max-height: 400px;
        overflow-y: auto;
    }
}
.left-card,
.right-card {
    display: flex;
    flex-direction: column;
}
.left-card .item-list-scroll {
    flex: 1 1 0;
    overflow-y: auto;
    max-height: 100%;
    padding-right: 2px;
    min-height: 0;
}
.right-card #calc-detail-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.right-card #calc-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   配方区域
   ============================================================ */
.recipe-area {
    max-height: calc(6 * 2.8rem + 2.5rem);
    overflow-y: auto;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
}
.recipe-area table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fdfaf3;
}
.recipe-area table tbody tr:last-child {
    border-bottom: none;
}
.recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.recipe-header .checkbox-group {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}
.recipe-header .checkbox-group label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-sm);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.recipe-header .checkbox-group label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--gold);
    cursor: pointer;
}
.recipe-footer {
    flex-shrink: 0;
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-light);
}

/* ============================================================
   成本 & 利润
   ============================================================ */
.cost-area {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    flex-wrap: wrap;
}
.cost-area .cost-item {
    font-size: var(--font-base);
}
.cost-area .cost-item .label {
    color: var(--text-secondary);
    font-weight: 500;
}
.cost-area .cost-item .value {
    font-weight: 700;
    color: var(--red);
    font-size: var(--font-lg);
}
.price-expect-highlight {
    background: linear-gradient(135deg, #fef7e6 0%, #fdf2d8 100%);
    border: 1px solid var(--gold-light);
    border-radius: var(--radius-lg);
    padding: 0.9rem 1.1rem;
}
.price-input-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.price-input-group .field-group {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}
.price-input-group .field-group label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}
.price-input-group .field-group input {
    width: 85px;
    padding: 0.3rem 0.4rem;
    font-size: var(--font-base);
    text-align: right;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: #fff;
}
.price-input-group .field-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.12);
    outline: none;
}
.profit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-md);
}
.profit-grid .profit-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 0.6rem 0.8rem;
    transition: background 0.15s;
}
.profit-grid .profit-item:hover {
    background: rgba(200, 164, 92, 0.04);
}
@media (max-width: 640px) {
    .profit-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 480px) {
    .profit-grid {
        grid-template-columns: 1fr;
    }
}
.profit-value {
    font-size: var(--font-xl);
    font-weight: 700;
    min-height: 2.2rem;
}
.profit-label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}
.single-profit {
    font-weight: 700;
    font-size: var(--font-xl);
}
.single-profit.positive {
    color: var(--jade-dark);
}
.single-profit.negative {
    color: var(--red);
}
.profit-split {
    display: flex;
    align-items: stretch;
    gap: var(--space-sm);
}
.profit-split .left {
    flex: 7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.1rem;
}
.profit-split .divider {
    width: 1px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0.2rem 0;
}
.profit-split .right {
    flex: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.profit-split .right .label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}
.profit-split .left .label-sm {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    display: inline-block;
    margin-right: 0.2rem;
}
.profit-split .left .value {
    font-weight: 600;
    font-size: var(--font-base);
}
.profit-split .left .value.positive,
.profit-split .right .value.positive {
    color: var(--jade-dark);
}
.profit-split .left .value.negative,
.profit-split .right .value.negative {
    color: var(--red);
}
.profit-split .right .value {
    font-weight: 700;
    font-size: var(--font-lg);
}
.profit-item-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.15rem 0;
    line-height: 1.3;
}
.profit-item-name {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    font-weight: 500;
}
.profit-item-value {
    font-size: var(--font-xl);
    font-weight: 700;
}
.profit-item-value.positive {
    color: var(--jade-dark);
}
.profit-item-value.negative {
    color: var(--red);
}
.profit-single-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
}
.profit-single-header .profit-label {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}
.single-calc-badge {
    font-size: var(--font-xs);
    background: rgba(200, 164, 92, 0.15);
    color: var(--gold-dark);
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-md);
    margin-left: 0.4rem;
    font-weight: 500;
}

/* ============================================================
   合成信息
   ============================================================ */
.synth-info {
    font-size: var(--font-md);
    color: var(--text-secondary);
}
.synth-info strong {
    color: var(--text-primary);
}
.synth-info-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    background: #faf8f5;
    border-radius: var(--radius-md);
    padding: 0.3rem 0.6rem;
    margin-top: 0.2rem;
}
.synth-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
    cursor: pointer;
    flex-shrink: 0;
}
.synth-checkbox-label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.to-limit-indicator {
    font-size: 0.6rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-left: var(--space-xs);
}
.synth-count-input {
    width: 60px;
    padding: 0.1rem 0.2rem;
    font-size: var(--font-md);
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-input);
    display: inline-block;
}
.synth-count-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.12);
    outline: none;
}
.synth-count-input:disabled {
    background: #f0ede8;
    color: var(--text-secondary);
    cursor: not-allowed;
}
.synth-display-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.synth-display-wrapper .synth-main {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
}
.synth-display-wrapper .synth-main .count-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
}
.synth-display-wrapper .synth-main .count-input-wrap .synth-count-input {
    width: 55px;
    padding: 0.1rem 0.2rem;
    font-size: var(--font-md);
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-input);
}
.synth-display-wrapper .synth-main .count-input-wrap .synth-count-input:disabled {
    background: #f0ede8;
    color: var(--text-secondary);
    cursor: not-allowed;
}
.synth-display-wrapper .synth-main .count-suffix {
    font-size: var(--font-md);
    color: var(--text-secondary);
}
.synth-display-wrapper .synth-output {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}
.synth-output-table {
    display: table;
    width: 100%;
    max-width: 280px;
    border-collapse: collapse;
    font-size: var(--font-sm);
    margin-top: 0.2rem;
}
.synth-output-table .row {
    align-items: center;
    display: flex;
}
.synth-output-table .cell {
    display: table-cell;
    padding: 0.1rem 0.3rem;
    border-bottom: 1px solid var(--border-light);
}
.synth-output-table .row:last-child .cell {
    border-bottom: none;
}
.synth-output-table .cell.name {
    font-weight: 500;
    color: var(--text-primary);
}
.synth-output-table .cell.qty {
    text-align: right;
    font-weight: 600;
    color: var(--text-secondary);
}
.synth-output-table .cell.qty.current {
    color: var(--blue);
}
.synth-output-table .cell.qty.target {
    color: var(--red);
}
.synth-table{
    display: flex;
    flex-wrap: nowrap;      /* 强制不换行 */
    align-items: center;    /* 垂直居中 */
    gap: 6px;               /* 子元素间距（可选） */
    white-space: nowrap;    /* 额外保险，防止内部文字换行 */
    overflow: hidden;       /* 如果内容超出，隐藏溢出（可选） */
}

/* ============================================================
   幸运标签
   ============================================================ */
.lucky-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-2xl);
    font-size: var(--font-sm);
    font-weight: 600;
    background: rgba(74, 111, 165, 0.12);
    color: var(--blue);
    border: 1px solid rgba(74, 111, 165, 0.2);
    white-space: nowrap;
}
.lucky-tag.increase {
    background: rgba(74, 111, 165, 0.10);
    color: var(--blue);
    border-color: rgba(74, 111, 165, 0.2);
}
.lucky-tag.upgrade {
    background: rgba(181, 52, 58, 0.10);
    color: var(--red);
    border-color: rgba(181, 52, 58, 0.15);
}
.lucky-tag .pct {
    font-weight: 700;
    font-size: var(--font-md);
}

/* ============================================================
   模态框
   ============================================================ */
.modal-card {
    animation: slideUp 0.25s ease;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-overlay {
    display: flex;
}
.modal-overlay.hidden {
    display: none;
}
.modal-detail-scroll {
    max-height: 75vh;
    overflow-y: auto;
}

/* ============================================================
   自定义下拉选择器
   ============================================================ */
.custom-select-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    min-width: 180px;
}
.custom-select-wrap .select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: var(--space-xs);
    padding: 0.4rem 0.8rem;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--font-base);
    transition: border-color var(--transition), box-shadow var(--transition);
    user-select: none;
    min-width: 0;
}
.custom-select-wrap .select-trigger .selected-name {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
}
.custom-select-wrap .select-trigger .arrow {
    flex-shrink: 0;
    margin-left: var(--space-sm);
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.custom-select-wrap .select-trigger.open {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(200, 164, 92, 0.15);
    background: #fffbf5;
}
.custom-select-wrap .select-trigger.open .arrow {
    transform: rotate(180deg);
}
.select-dropdown {
    display: none;
    z-index: 9999;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    flex-direction: column;
}
.select-dropdown.open {
    display: flex;
}
.options-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.2rem 0;
    order: 0;
}
.options-container .option-item {
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: var(--font-md);
    transition: background 0.1s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.options-container .option-item:hover {
    background: var(--bg-page);
}
.options-container .option-item.selected {
    background: #fdf4e2;
    font-weight: 500;
}
.options-container .option-item .opt-label {
    font-size: 0.7rem;
    color: var(--gold-dark);
    margin-left: var(--space-sm);
}
.no-match {
    padding: 0.4rem 0.8rem;
    color: #999;
    font-size: var(--font-sm);
    text-align: center;
}
.search-container {
    border-top: 1px solid var(--border);
    padding: 0.4rem 0.6rem;
    background: #faf8f5;
    flex-shrink: 0;
    order: 1;
}
.search-container input {
    width: 100%;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: var(--font-sm);
    background: #fff;
}
.search-container input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.15);
}

/* ============================================================
   技能书选择器面板
   ============================================================ */
.skill-selector-panel {
    position: fixed;
    z-index: 9999;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    display: none;
    flex-direction: column;
    min-width: 240px;
    max-width: 420px;
}
.skill-selector-panel.open {
    display: flex;
}
.skill-selector-panel .search-container {
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding: 6px 10px;
    background: #faf8f5;
    flex-shrink: 0;
    order: 0;
}
.skill-selector-panel .search-container input {
    width: 100%;
    padding: 6px 10px 6px 30px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: var(--font-md);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 8px center;
    background-size: 14px;
}
.skill-selector-panel .search-container input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.15);
    outline: none;
}
.skill-selector-panel .options-container {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    max-height: 200px;
    order: 1;
}
.skill-selector-panel .options-container .option-item {
    padding: 6px 12px;
    cursor: pointer;
    font-size: var(--font-md);
    transition: background 0.1s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.skill-selector-panel .options-container .option-item:hover {
    background: var(--bg-page);
}
.skill-selector-panel .options-container .option-item.selected {
    background: #fdf4e2;
    font-weight: 500;
}
.skill-selector-panel .options-container .option-item .opt-label {
    font-size: 0.7rem;
    color: var(--gold-dark);
    white-space: nowrap;
}

/* ============================================================
   技能书配方表格
   ============================================================ */
.skill-recipe-table {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.skill-recipe-table table {
    width: 100%;
}
.skill-recipe-table table thead {
    background: #fdfaf3;
    border-bottom: 2px solid var(--gold-light);
}
.skill-recipe-table table thead th {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6rem 0.8rem;
}
.skill-recipe-table table tbody td {
    padding: 0.5rem 0.8rem;
    font-size: var(--font-base);
    border-bottom: 1px solid #f2efe7;
}
.skill-recipe-table table tbody tr:last-child td {
    border-bottom: none;
}
.skill-recipe-table .empty-row td {
    text-align: center;
    color: #b0a89a;
    padding: 1.2rem 0.8rem;
    font-style: italic;
}
.skill-recipe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: var(--space-sm);
}
.skill-recipe-header .label {
    font-size: var(--font-base);
    font-weight: 500;
    color: var(--text-primary);
}
.skill-recipe-header .add-btn {
    font-size: var(--font-md);
    font-weight: 500;
    color: var(--blue);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    transition: background 0.15s;
}
.skill-recipe-header .add-btn:hover {
    background: rgba(74, 111, 165, 0.08);
}
.skill-del-btn {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.06);
    border: none;
    border-radius: 6px;
    padding: 0.15rem 0.5rem;
    cursor: pointer;
    font-size: var(--font-sm);
    transition: background 0.15s;
}
.skill-del-btn:hover {
    background: rgba(192, 57, 43, 0.15);
}
.skill-material-tag {
    display: inline-block;
    background: var(--border-light);
    border: 1px solid #d5cdc0;
    border-radius: var(--radius-lg);
    padding: 0.1rem 0.7rem;
    margin: 0.1rem 0.2rem;
    font-size: var(--font-sm);
    color: var(--text-primary);
    white-space: nowrap;
}

/* ============================================================
   可点击材料
   ============================================================ */
.recipe-area .cell-name-with-icon.clickable-material,
#detail-modal .cell-name-with-icon.clickable-material {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 2px 14px 2px 6px;
    border: 1.5px solid var(--gold);
    border-radius: 6px;
    background: rgba(200, 164, 92, 0.10);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    color: var(--gold-dark);
    font-size: var(--font-md);
    line-height: 1.6;
    white-space: nowrap;
    text-decoration: none;
}
.recipe-area .cell-name-with-icon.clickable-material:hover,
#detail-modal .cell-name-with-icon.clickable-material:hover {
    background: rgba(200, 164, 92, 0.22);
    border-color: var(--red);
    box-shadow: 0 2px 10px rgba(181, 52, 58, 0.15);
    transform: translateY(-1px);
    color: var(--red);
}
.recipe-area .cell-name-with-icon.clickable-material::after,
#detail-modal .cell-name-with-icon.clickable-material::after {
    content: " ▶";
    font-size: 0.6rem;
    opacity: 0.5;
    color: var(--gold);
    transition: transform 0.2s, opacity 0.2s;
}
.recipe-area .cell-name-with-icon.clickable-material:hover::after,
#detail-modal .cell-name-with-icon.clickable-material:hover::after {
    transform: translateX(3px);
    opacity: 0.9;
    color: var(--red);
}

/* ============================================================
   管理页：表格 & 工具栏
   ============================================================ */
.m-toolbar-sticky {
    position: sticky;
    z-index: 40;
    background: var(--bg-card);
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
}
.m-thead-sticky {
    position: sticky;
    top: 0;
    z-index: 35;
    background: #fdfaf3;
}
.m-table-wrap {
    max-height: 65vh;
    overflow-y: auto;
}
.m-table-wrap table {
    width: 100%;
}
.m-table-wrap table tbody tr:nth-child(even) {
    background: rgba(245, 240, 232, 0.3);
}
.m-table-wrap table tbody tr:hover {
    background: rgba(200, 164, 92, 0.08);
}
.craft-badge-mini {
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-lg);
    background: rgba(200, 164, 92, 0.12);
    color: var(--gold-dark);
    white-space: nowrap;
    display: inline-block;
}
.data-source-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-lg);
    background: rgba(90, 138, 106, 0.12);
    color: var(--jade-dark);
    display: inline-block;
    margin-left: var(--space-sm);
}
.data-source-badge.server {
    background: rgba(74, 111, 165, 0.12);
    color: var(--blue);
}
.data-source-badge.local {
    background: rgba(200, 164, 92, 0.12);
    color: var(--gold-dark);
}
.data-source-badge.default {
    background: rgba(181, 52, 58, 0.08);
    color: var(--red);
}

/* ============================================================
   副本价格卡片
   ============================================================ */
.dungeon-price-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 2px 0;
}
.dungeon-price-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px 16px;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 0;
    box-shadow: var(--shadow-sm);
}
.dungeon-price-card:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(200, 164, 92, 0.14);
    transform: translateY(-2px);
    background: var(--bg-card);
}
.dungeon-price-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
}
.dungeon-price-card .mat-name-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}
.dungeon-price-card .mat-name-wrap .mat-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-page);
    object-fit: contain;
    flex-shrink: 0;
}
.dungeon-price-card .mat-name {
    font-weight: 600;
    font-size: var(--font-base);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dungeon-price-card .card-tags {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}
.dungeon-price-card .tag {
    font-size: 0.6rem;
    padding: 2px 10px;
    border-radius: var(--radius-lg);
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.dungeon-price-card .tag-craft {
    background: rgba(74, 111, 165, 0.10);
    color: var(--blue);
    border: 1px solid rgba(74, 111, 165, 0.15);
}
.dungeon-price-card .tag-global {
    background: rgba(90, 138, 106, 0.12);
    color: var(--jade-dark);
    border: 1px solid rgba(90, 138, 106, 0.18);
}
.dungeon-price-card .price-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: 2px;
    background: #faf8f5;
    border-radius: var(--radius-md);
    padding: 3px 10px 3px 12px;
    border: 1px solid var(--border);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.dungeon-price-card .price-row:focus-within {
    border-color: var(--gold);
    background: #fffbf5;
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.10);
}
.dungeon-price-card .price-row .price-input {
    flex: 1;
    padding: 4px 2px 4px 6px;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
    text-align: right;
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
    width: 100%;
    font-family: var(--font-family);
}
.dungeon-price-card .price-row .price-unit {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.6;
    white-space: nowrap;
}
.dungeon-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 20px;
    font-size: var(--font-base);
    opacity: 0.5;
    grid-column: 1 / -1;
    background: #faf8f5;
    border-radius: var(--radius-lg);
    border: 1.5px dashed var(--border);
    font-style: italic;
}
.dungeon-section-title {
    display: flex;
    align-items: center;
    gap: var(--radius-md);
    margin-bottom: 14px;
}
.dungeon-section-title .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border) 0%, transparent 100%);
}
.dungeon-section-title .icon {
    font-size: var(--font-lg);
}
@media (max-width: 1100px) {
    .dungeon-price-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .dungeon-price-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .dungeon-price-card {
        padding: 12px 14px 14px;
    }
}
@media (max-width: 480px) {
    .dungeon-price-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 表格操作按钮通用样式 ========== */
.table-action-btn {
    font-size: 0.75rem;
    margin-left: 6px;
}
.table-action-btn:first-child {
    margin-left: 0;
}

/* 复制按钮（装备打造专用） */
.copy-btn {
    background: rgba(232,184,75,0.15);
    color: #b8860b;
    border: 1px solid rgba(232,184,75,0.25);
    border-radius: 6px;
    padding: 0.15rem 0.7rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    margin-left: 6px;
}
.copy-btn:first-child {
    margin-left: 0;
}
.copy-btn:hover {
    background: rgba(232,184,75,0.25);
    border-color: rgba(232,184,75,0.5);
}

/* 编辑按钮（蓝色） */
.btn-ghost.edit.table-action-btn {
    color: #4a6fa5;
    border-color: #4a6fa5;
}
.btn-ghost.edit.table-action-btn:hover {
    background: rgba(74,111,165,0.1);
}

/* 删除按钮（红色） */
.btn-ghost.del.table-action-btn {
    color: #b5343a;
    border-color: #b5343a;
}
.btn-ghost.del.table-action-btn:hover {
    background: rgba(181,52,58,0.1);
}

/* 副本编辑（同编辑按钮） */
.btn-ghost.dungeon-edit.table-action-btn {
    color: #4a6fa5;
    border-color: #4a6fa5;
}
.btn-ghost.dungeon-edit.table-action-btn:hover {
    background: rgba(74,111,165,0.1);
}

/* 副本删除（同删除按钮） */
.btn-ghost.dungeon-del.table-action-btn {
    color: #b5343a;
    border-color: #b5343a;
}
.btn-ghost.dungeon-del.table-action-btn:hover {
    background: rgba(181,52,58,0.1);
}

/* ============================================================
   输入框清除按钮
   ============================================================ */
.input-clear-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}
.input-clear-wrapper input {
    width: 100%;
    padding-right: 30px;
}
.input-clear-wrapper .clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    font-size: 16px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
    z-index: 2;
}
.input-clear-wrapper .clear-btn:hover {
    color: var(--red);
    background: rgba(181, 52, 58, 0.08);
}
.input-clear-wrapper .clear-btn.visible {
    display: block;
}

/* ============================================================
   外购价格输入
   ============================================================ */
.buyout-price-input {
    width: 85px;
    padding: 0.1rem 0.2rem;
    font-size: var(--font-sm);
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: #fff;
    display: inline-block;
}
.buyout-price-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.12);
    outline: none;
}
.buyout-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================================
   价格标签 & 来源标签
   ============================================================ */
.price-inline {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}
.price-inline img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid var(--border);
    background: var(--bg-page);
    flex-shrink: 0;
}
.price-inline+.price-inline {
    margin-left: 2px;
}
.source-tag {
    display: inline-block;
    padding: 1px 10px;
    border-radius: var(--radius-lg);
    font-size: 0.7rem;
    font-weight: 500;
    margin: 1px 3px 1px 0;
    white-space: nowrap;
    background: rgba(200, 164, 92, 0.12);
    color: var(--gold-dark);
    border: 1px solid rgba(200, 164, 92, 0.15);
}
.source-tag.shop {
    background: rgba(74, 111, 165, 0.10);
    color: var(--blue);
    border-color: rgba(74, 111, 165, 0.15);
}
.source-tag.dungeon {
    background: rgba(181, 52, 58, 0.08);
    color: var(--red);
    border-color: rgba(181, 52, 58, 0.12);
}
.source-tag.global {
    background: rgba(90, 138, 106, 0.12);
    color: var(--jade-dark);
    border-color: rgba(90, 138, 106, 0.18);
}
.source-tag.default {
    background: rgba(200, 164, 92, 0.12);
    color: var(--gold-dark);
    border-color: rgba(200, 164, 92, 0.15);
}

/* ============================================================
   幸运配置 & 生产关联区域
   ============================================================ */
.lucky-config-area,
.production-link-area {
    background: #f8f6f2;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.8rem 1rem;
    margin-top: var(--space-sm);
    flex-shrink: 0;
}
.lucky-config-area .label-sm,
.production-link-area .label-sm {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
}
.lucky-config-area input[type="number"],
.lucky-config-area select,
.production-link-area select {
    padding: 0.2rem 0.5rem;
    font-size: var(--font-md);
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: #fff;
}
.lucky-config-area input[type="number"]:focus,
.lucky-config-area select:focus,
.production-link-area select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.12);
    outline: none;
}
.lucky-config-area .inline-group,
.production-link-area .inline-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.production-link-area select {
    min-width: 150px;
}
.production-link-area .link-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.7;
}
.link-checkbox-cell {
    text-align: center;
    white-space: nowrap;
}
.link-checkbox-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
    cursor: pointer;
}
.link-checkbox-cell .link-disabled {
    color: #ccc;
    font-size: 0.7rem;
}
.checkbox-group .link-toggle-label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-sm);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}
.checkbox-group .link-toggle-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--gold);
    cursor: pointer;
}

/* ============================================================
   字段行 (4列)
   ============================================================ */
.field-row-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 70px;
    gap: var(--space-md);
}
@media (max-width: 600px) {
    .field-row-4 {
        grid-template-columns: 1fr 1fr;
    }
}
.field-row-4 .field-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.field-row-4 .field-group label {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}
.field-row-4 .field-group input,
.field-row-4 .field-group select {
    padding: 0.4rem 0.5rem;
    font-size: var(--font-base);
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--bg-input);
    width: 100%;
}

/* ============================================================
   购物车
   ============================================================ */
#cart-panel {
    display: none;
}
#cart-panel.open {
    display: flex;
    transform: translateX(0);
}
#cart-overlay.open {
    display: block;
}
.cart-item-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}
.cart-item-card:hover {
    box-shadow: 0 2px 12px rgba(61, 50, 38, 0.08);
}
.cart-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    gap: var(--space-sm);
}
.cart-item-header:hover {
    background: #faf8f5;
}
.cart-item-header .left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
}
.cart-item-header .left .name {
    font-weight: 600;
    font-size: var(--font-base);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-header .left .level {
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(200, 164, 92, 0.12);
    padding: 0 8px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.cart-item-header .right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}
.cart-item-header .right .qty {
    font-size: var(--font-md);
    color: var(--text-secondary);
    font-weight: 500;
}
.cart-item-header .right .cost {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--red);
}
.cart-item-header .right .arrow {
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform var(--transition);
    margin-left: 2px;
}
.cart-item-header .right .arrow.open {
    transform: rotate(180deg);
}
.cart-item-header .right .del-btn {
    background: transparent;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: var(--font-lg);
    padding: 0 4px;
    transition: color 0.2s;
    line-height: 1;
}
.cart-item-header .right .del-btn:hover {
    color: var(--red);
}
.cart-item-body {
    display: none;
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid var(--border-light);
    overflow: hidden;
}
.cart-item-body.open {
    display: block;
}
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    opacity: 0.5;
    padding: 40px 20px;
}
.cart-empty .icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
}
.cart-empty .text {
    font-size: var(--font-base);
}
.subsection {
    margin-top: 0.6rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background: #faf8f5;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    font-weight: 600;
    font-size: var(--font-sm);
    color: var(--text-primary);
}
.subsection-header:hover {
    background: #f3efe8;
}
.subsection-header .toggle-icon {
    font-size: 0.6rem;
    color: var(--text-secondary);
    transition: transform var(--transition);
}
.subsection-header .toggle-icon.open {
    transform: rotate(180deg);
}
.subsection-content {
    padding: 0.8rem 1rem;
    background: var(--bg-subsection);
    border-top: 1px solid var(--border-light);
}
.subsection-content.hidden {
    display: none;
}
.subsection-content table {
    font-size: var(--font-sm);
    width: 100%;
    border-collapse: collapse;
}
.subsection-content table th {
    text-align: left;
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.2rem 0.3rem;
    border-bottom: 1px solid var(--border-light);
}
.subsection-content table td {
    padding: 0.15rem 0.3rem;
    border-bottom: 1px solid #f5f0e8;
}
.subsection-content table .text-right {
    text-align: right;
}
.subsection-content table .text-center {
    text-align: center;
}
.subsection-content .total-row {
    border-top: 2px solid var(--gold-light);
    background: #faf8f5;
    font-weight: 700;
}

/* ============================================================
   返回顶部按钮
   ============================================================ */
#back-to-top {
    position: fixed;
    top: 60%;
    z-index: 20;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 50%;
    line-height: 0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-100px);
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#back-to-top.show {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}
#back-to-top:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
#back-to-top img {
    display: block;
}
@media (max-width: 640px) {
    #back-to-top {
        width: 40px;
        height: 40px;
        top: 12%;
    }
}

/* ============================================================
   通用工具类
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }
.items-stretch { align-items: stretch; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-xs); }
.gap-2 { gap: var(--space-sm); }
.gap-3 { gap: var(--space-md); }
.gap-4 { gap: var(--space-lg); }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-sm { font-size: var(--font-sm); }
.text-xs { font-size: var(--font-xs); }
.text-base { font-size: var(--font-base); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.p-1 { padding: var(--space-xs); }
.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }
.rounded { border-radius: 6px; }
.rounded-lg { border-radius: var(--radius-lg); }
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.bg-white { background: var(#fff); }
.bg-mtk { background: var(--border-light); }
.bg-lmy { background: var(--bg-card); }
.bg-transparent { background: transparent; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-ink { color: var(--text-primary); }
.text-ink-light { color: var(--text-secondary); }
.text-gold { color: var(--gold); }
.text-red { color: var(--red); }
.text-jade { color: var(--jade); }
.text-blue { color: var(--blue); }
.card-inner { padding: 0.6rem 0.8rem; }
.section-divider {
    border-top: 1px solid var(--border);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
}
.background { background: var(--bg-subsection); }
@media (max-width: 480px) {
    #stack-profit-container .profit-label { font-size: var(--font-sm); }
    #stack-profit-container .profit-value { font-size: var(--font-lg); }
}

/* ============================================================
   功能卡片网格（统一）
   ============================================================ */

.func-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    padding: 8px 0;
}
.func-grid.hidden { display: none; }
.func-grid:not(.hidden) { display: grid; }

.func-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1.5px solid var(--border-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
    position: relative;
    user-select: none;
    overflow: hidden; 
}
.func-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 0 0 14px 14px; /* 匹配卡片底部圆角 */
    background: linear-gradient(90deg, var(--gold-light), var(--gold), var(--gold-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.func-card:hover {
    border-color: var(--gold);
    box-shadow: 0 6px 20px rgba(200, 164, 92, 0.15);
    transform: translateY(-3px);
}
.func-card:hover::before { opacity: 1; }
.func-card:active { transform: scale(0.97); }
.func-card.expanded {
    border-color: var(--gold);
    background: #fef9f0;
    box-shadow: 0 4px 16px rgba(200, 164, 92, 0.2);
}
.func-card.expanded::before { opacity: 1; }
.func-card.active-func {
    border-color: var(--gold);
    background: #fef9f0;
    box-shadow: 0 4px 16px rgba(200, 164, 92, 0.2);
}
/*.func-card.active-func::before { opacity: 1; }*/

.func-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 1rem;
    background: #faf8f5;
    border-radius: 16px;
    border: 1.5px dashed var(--border);
}

.func-detail-content {
    animation: fadeSlideIn 0.3s ease;
    background: #faf8f5;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border-light);
    margin-top: 12px;
    display: none;
}
.func-detail-content.hidden {
    display: none;
    }
.func-detail-content.active {
    display: block;
    }

.func-grid .func-card {
    cursor: pointer;
    pointer-events: auto;
}

/* 确保功能卡片网格显示正常 */
#mtab-more .func-grid,
#page-more .func-grid {
    display: grid !important;
}

.func-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}
.func-detail-header .func-detail-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Noto Serif SC', serif;
}
.func-detail-header .func-collapse-btn {
    font-size: 0.85rem;
    padding: 4px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.func-detail-header .func-collapse-btn:hover {
    border-color: var(--red);
    color: var(--red);
    background: rgba(181, 52, 58, 0.06);
}

.func-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0 12px 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.func-toolbar .func-search {
    flex: 1;
    min-width: 180px;
    padding: 0.4rem 1rem 0.4rem 1.8rem;
    border-radius: var(--radius-2xl);
    border: 1.5px solid var(--border);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
    background-size: 14px;
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition);
}
.func-toolbar .func-search:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.12);
}
.func-toolbar .func-search::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}
.func-toolbar .btn-sm {
    padding: 0.4rem 1.2rem;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.func-table-wrap {
    max-height: 55vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
}
.func-table-wrap table {
    width: 100%;
}
.func-table-wrap table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fdfaf3;
}
.func-table-wrap table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 2px solid var(--gold-light);
}
.func-table-wrap table td {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    border-bottom: 1px solid #f2efe7;
}
.func-table-wrap table tbody tr:last-child td { border-bottom: none; }
.func-table-wrap table tbody tr:hover { background: rgba(200, 164, 92, 0.04); }

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

/* ============================================================
   活跃度计算
   ============================================================ */
#func-detail-activity .activity-stat-row {
    position: sticky;
    top: 138px;
    z-index: 40;
    background: #faf8f5;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    margin: 0 0 16px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}
#func-detail-activity .level-selector-inline {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 0;
}
#func-detail-activity .level-selector-inline .level-label,
#func-detail-activity .level-selector-inline .level-suffix {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}
#func-detail-activity .level-selector-inline .level-select-sm {
    font-size: 2rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--red);
    width: 70px;
    text-align: center;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px center;
    padding-right: 22px;
    box-sizing: content-box;
}
#func-detail-activity .level-selector-inline .level-select-sm:hover {
    background-color: rgba(200, 164, 92, 0.06);
    border-radius: 4px;
}
#func-detail-activity .level-selector-inline .level-select-sm:focus {
    outline: none;
    background-color: rgba(200, 164, 92, 0.10);
    border-radius: 4px;
}
#func-detail-activity .progress-wrapper {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}
#func-detail-activity .active-progress-track,
.daily-sidebar .active-progress-track,
.daily-modal-right .active-progress-track {
    position: relative;
    height: 28px;
    background: #e8e0d5;
    border-radius: 20px;
    overflow: visible;
}
#func-detail-activity .active-progress-track .fill,
.daily-sidebar .active-progress-track .fill,
.daily-modal-right .active-progress-track .fill {
    height: 100%;
    background: linear-gradient(90deg, #e8b84b, #c8a45c, #b8860b);
    border-radius: 20px;
    transition: width 0.5s ease;
    width: 0%;
}
.markers {
    display: flex;
    justify-content: center;
}
#func-detail-activity .active-progress-track .markers,
.daily-sidebar .active-progress-track .markers,
.daily-modal-right .active-progress-track .markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}
#func-detail-activity .active-progress-track .markers span,
.daily-sidebar .active-progress-track .markers span,
.daily-modal-right .active-progress-track .markers span {
    position: absolute;
    font-size: 0.6rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    background: rgba(0, 0, 0, 0.25);
    padding: 1px 8px;
    border-radius: 10px;
    line-height: 1.6;
    backdrop-filter: blur(2px);
    white-space: nowrap;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}
#func-detail-activity .active-progress-track .markers .active-marker,
.daily-sidebar .active-progress-track .markers .active-marker,
.daily-modal-right .active-progress-track .markers .active-marker {
    background: rgba(181, 52, 58, 0.75);
    color: #fff;
    box-shadow: 0 0 12px rgba(181, 52, 58, 0.3);
    transform: translateY(-50%) scale(1.05);
}
#func-detail-activity .stat-item .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}
#func-detail-activity .stat-item .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--red);
    line-height: 1.2;
}
#func-detail-activity .active-two-column {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    align-items: stretch;
}
#func-detail-activity .active-left-col {
    flex: 0 0 280px;
    min-width: 240px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}
#func-detail-activity .active-right-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
#func-detail-activity .plan-section {
    background: #faf8f5;
    border: 1.5px solid var(--border-light);
    border-radius: 14px;
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    min-height: 200px;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
}
#func-detail-activity .plan-section .plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
#func-detail-activity .plan-section .plan-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
    flex-shrink: 0;
}
#func-detail-activity .plan-section .plan-header .btn-primary {
    flex-shrink: 0;
}
#func-detail-activity #scheme-card-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 1 auto;
    overflow-y: auto;
    max-height: 320px;
    width: 100%;
    padding: 0;
}
#func-detail-activity #scheme-card-grid .scheme-card {
    background: #fff;
    border: 1.5px solid var(--border-light);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}
#func-detail-activity #scheme-card-grid .scheme-card:hover {
    border-color: var(--gold);
    box-shadow: 0 2px 12px rgba(200, 164, 92, 0.12);
}
#func-detail-activity #scheme-card-grid .scheme-card.active-scheme {
    border-color: var(--gold);
    background: #fef9f0;
}
#func-detail-activity #scheme-card-grid .scheme-card .scheme-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
}
#func-detail-activity #scheme-card-grid .scheme-card .card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
#func-detail-activity #scheme-card-grid .scheme-card .card-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}
#func-detail-activity #scheme-card-grid .scheme-card .scheme-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 2px;
    width: 100%;
}
#func-detail-activity #scheme-card-grid .scheme-card .scheme-card-actions button {
    font-size: 0.7rem;
    padding: 2px 14px;
    border-radius: 6px;
    border: 1.5px solid var(--border-light);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    min-width: 44px;
}
#func-detail-activity #scheme-card-grid .scheme-card .scheme-card-actions .btn-apply {
    border-color: var(--gold);
    color: var(--gold-dark);
    background: rgba(200, 164, 92, 0.06);
}
#func-detail-activity #scheme-card-grid .scheme-card .scheme-card-actions .btn-apply:hover {
    background: rgba(200, 164, 92, 0.18);
}
#func-detail-activity #scheme-card-grid .scheme-card .scheme-card-actions .btn-edit {
    border-color: var(--blue-light);
    color: var(--blue);
}
#func-detail-activity #scheme-card-grid .scheme-card .scheme-card-actions .btn-edit:hover {
    background: rgba(74, 111, 165, 0.12);
}
#func-detail-activity #scheme-card-grid .scheme-card .scheme-card-actions .btn-delete {
    border-color: var(--red-light);
    color: var(--red);
}
#func-detail-activity #scheme-card-grid .scheme-card .scheme-card-actions .btn-delete:hover {
    background: rgba(181, 52, 58, 0.12);
}
#func-detail-activity .active-right-col .task-section {
    background: #faf8f5;
    border: 1.5px solid var(--border-light);
    border-radius: 14px;
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
}
#func-detail-activity .active-right-col .task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
#func-detail-activity .active-right-col .task-header .task-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}
#func-detail-activity .active-right-col .task-header .clear-btn {
    font-size: 0.8rem;
    color: var(--red);
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}
#func-detail-activity .active-right-col .task-header .clear-btn:hover {
    background: rgba(181, 52, 58, 0.08);
}
#func-detail-activity #active-task-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    border: none;
    background: transparent;
    padding: 0;
}
#func-detail-activity #active-task-list .active-task-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px 14px 18px;
    min-height: 76px;
    border: 1.5px solid var(--border-light);
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin: 0;
}
#func-detail-activity #active-task-list .active-task-item:hover {
    border-color: var(--gold);
    box-shadow: 0 8px 30px rgba(200, 164, 92, 0.18);
    transform: translateY(-3px);
    background: #fdfcf9;
}
#func-detail-activity #active-task-list .active-task-item.selected {
    background: #fef9f0;
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(200, 164, 92, 0.25);
}
#func-detail-activity #active-task-list .active-task-item .task-left-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 0;
}
#func-detail-activity #active-task-list .active-task-item .task-top-row {
    display: flex;
    align-items: center;
    padding: 0;
}
#func-detail-activity #active-task-list .active-task-item .task-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
}
#func-detail-activity #active-task-list .active-task-item .task-bottom-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
}
#func-detail-activity #active-task-list .active-task-item .task-count-display {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 52px;
    text-align: right;
    flex-shrink: 0;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
#func-detail-activity #active-task-list .active-task-item .task-count-display.done {
    color: var(--jade-dark);
}
#func-detail-activity #active-task-list .active-task-item .task-count-display.partial {
    color: #b8860b;
}
#func-detail-activity #active-task-list .active-task-item .task-progress-wrapper {
    flex: 1;
    min-width: 40px;
}
#func-detail-activity #active-task-list .active-task-item .task-progress-bar {
    height: 16px;
    background: #f0ede8;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}
#func-detail-activity #active-task-list .active-task-item .task-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#func-detail-activity #active-task-list .active-task-item .task-active-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 6px rgba(255, 255, 255, 0.7);
    pointer-events: none;
    line-height: 1;
    z-index: 2;
    font-variant-numeric: tabular-nums;
}
#func-detail-activity #active-task-list .active-task-item .task-fav-btn {
    height: 100%;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
    border-radius: 10px;
    border: 2px solid var(--border-light);
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
    min-height: 44px;
    min-width: 44px;
}
#func-detail-activity #active-task-list .active-task-item .task-fav-btn:hover {
    border-color: var(--gold);
    background: linear-gradient(145deg, #fdf6e8, #f8edd6);
    color: var(--gold-dark);
    box-shadow: 0 4px 16px rgba(184, 134, 11, 0.20);
    transform: scale(1.03);
}
#func-detail-activity #active-task-list .active-task-item .task-fav-btn.active {
    border-color: #b5343a;
    background: linear-gradient(145deg, #fce8e8, #f5d6d6);
    color: #b5343a;
    box-shadow: 0 4px 16px rgba(181, 52, 58, 0.20);
}
#func-detail-activity #active-task-list .active-task-item .task-fav-btn.active:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 24px rgba(181, 52, 58, 0.30);
}
#func-detail-activity .task-table-header {
    display: none;
}
#func-detail-activity #active-task-list .active-task-item .task-info {
    display: contents;
}
#func-detail-activity #active-task-list .active-task-item .task-count,
#func-detail-activity #active-task-list .active-task-item .task-active {
    display: none;
}
#func-detail-activity #active-task-list .no-tasks-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 16px;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: #faf8f5;
    border-radius: 12px;
    border: 1.5px dashed var(--border-light);
}
#func-detail-activity .active-salary-section {
    margin-top: 4px;
    background: #faf8f5;
    border: 1.5px solid var(--border-light);
    border-radius: 14px;
    padding: 16px;
}
#func-detail-activity .active-salary-section .salary-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 12px;
}
#func-detail-activity .active-salary-section .active-salary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.active-left-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.active-left-col .plan-section { flex-shrink: 0; }
.active-left-col .active-salary-section { flex-shrink: 0; }
.active-right-col { flex: 1; min-width: 0; }

@media (max-width: 860px) {
    #func-detail-activity .active-two-column { flex-direction: column; }
    #func-detail-activity .active-left-col { flex: 1; min-width: 0; }
    #func-detail-activity #scheme-card-grid {
        max-height: 180px;
        flex-direction: row;
        flex-wrap: wrap;
        overflow-y: auto;
    }
    #func-detail-activity #scheme-card-grid .scheme-card {
        flex: 1 1 calc(50% - 6px);
        min-width: 120px;
    }
    #func-detail-activity .active-salary-section .active-salary-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 500px) {
    #func-detail-activity #scheme-card-grid .scheme-card { flex: 1 1 100%; }
    #func-detail-activity .active-salary-section .active-salary-grid { grid-template-columns: 1fr; }
    #func-detail-activity #active-task-list { grid-template-columns: 1fr; gap: 10px; }
    #func-detail-activity #active-task-list .active-task-item {
        padding: 12px 14px 12px 14px;
        min-height: 64px;
    }
    #func-detail-activity #active-task-list .active-task-item .task-name { font-size: 1rem; }
    #func-detail-activity #active-task-list .active-task-item .task-fav-btn {
        font-size: 0.8rem;
        min-height: 36px;
        min-width: 36px;
        border-radius: 8px;
    }
    #func-detail-activity #active-task-list .active-task-item .task-active-value { font-size: 0.75rem; }
    #func-detail-activity #active-task-list .active-task-item .task-count-display {
        font-size: 0.85rem;
        min-width: 44px;
    }
    #func-detail-activity #active-task-list .active-task-item .task-progress-bar {
        height: 14px;
        border-radius: 8px;
    }
    #func-detail-activity #active-task-list .active-task-item .task-bottom-row { gap: 8px; }
}

/* ============================================================
   活跃工资卡片
   ============================================================ */
.active-salary-card {
    background: #faf8f5;
    border-radius: 12px;
    padding: 12px 16px 10px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.active-salary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.active-salary-card.reached {
    border-color: var(--gold);
    background: #fef9f0;
}
.salary-header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 2px;
}
.salary-header-row .tier {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.salary-header-row .status-text {
    font-size: 0.8rem;
    font-weight: 600;
}
.salary-header-row .status-text.done { color: var(--jade-dark); }
.salary-header-row .status-text.pending { color: var(--text-secondary); }
.salary-formula {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--red);
    margin: 2px 0 4px 0;
    padding: 2px 0;
}
.salary-reward-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 2px 0 4px 0;
}
.salary-reward-row .reward-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.salary-reward-row .reward-item img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 3px;
}
.active-salary-card .progress-bar-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--border-light);
    width: 100%;
}
.active-salary-card .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-dark));
    width: 0%;
    transition: width 0.5s ease;
}
.active-salary-card.reached .progress-bar-fill {
    background: linear-gradient(90deg, var(--jade), var(--jade-dark));
}

/* ============================================================
   角色配置
   ============================================================ */
.character-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}
.character-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.character-name {
    font-weight: 700;
    font-size: 1.05rem;
}
.char-color-绿 { color: #2e7d32; }
.char-color-蓝 { color: #1565c0; }
.char-color-紫 { color: #6a1b9a; }
.char-color-金 { color: #b8860b; font-weight: 700; }
.character-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}
.character-info .career { font-weight: 500; }
.character-info .level { color: var(--text-muted); }
.character-stats-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 6px;
    padding: 0 2px;
}
.character-stats-labels .label { font-weight: 500; }
.character-stats-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-top: 2px;
    padding: 0 2px;
    flex-wrap: wrap;
    gap: 4px;
}
.character-stats-values .stat-item { display: flex; align-items: center; gap: 2px; }
.character-stats-values .stat-item .rank { font-weight: 500; }
.character-stats-values .stat-item .color-tag { font-weight: 600; }
.character-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    border-top: 1px solid var(--border-light);
    padding-top: 6px;
}
.character-power {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
    padding: 2px 0;
}
.character-power .power-label {
    font-weight: 500; 
    color: var(--text-secondary);
    
}
.character-power .rank {
    font-weight: 500;
    }
.character-power .color-tag {
    font-weight: 600;
    }

.team-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}
.team-card .team-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.team-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    border-bottom: 1px solid #f0ebe0;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}
.team-member:last-child { border-bottom: none; }
.team-member:hover { background: rgba(0, 0, 0, 0.03); }
.team-member .name { font-weight: 600; }
.team-member .meta { font-size: 0.8rem; color: var(--text-muted); }

/* ============================================================
   方案卡片
   ============================================================ */
.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
}
.plan-header .plan-label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}
.scheme-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 10px;
    width: 100%;
}
.scheme-card {
    background: #fff;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    padding: 14px 14px 12px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}
.scheme-card:hover {
    border-color: var(--gold);
    box-shadow: 0 4px 14px rgba(200, 164, 92, 0.12);
    transform: translateY(-2px);
}
.scheme-card.active-scheme {
    border-color: var(--gold);
    background: #fef9f0;
    box-shadow: 0 0 0 2px rgba(200, 164, 92, 0.15);
}
.scheme-card .card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scheme-card .card-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.scheme-card .card-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
    flex-wrap: wrap;
}
.scheme-card .card-actions button {
    font-size: 0.75rem;
    padding: 6px 12px;
    min-height: 32px;
    border-radius: 6px;
    border: 1.5px solid var(--border-light);
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    flex: 1;
    min-width: 40px;
}
.scheme-card .card-actions .btn-apply {
    border-color: var(--gold);
    color: var(--gold-dark);
    background: rgba(200, 164, 92, 0.06);
}
.scheme-card .card-actions .btn-apply:hover {
    background: rgba(200, 164, 92, 0.18);
    border-color: var(--gold);
}
.scheme-card .card-actions .btn-edit {
    border-color: var(--blue-light);
    color: var(--blue);
    background: rgba(74, 111, 165, 0.06);
}
.scheme-card .card-actions .btn-edit:hover {
    background: rgba(74, 111, 165, 0.15);
}
.scheme-card .card-actions .btn-delete {
    border-color: var(--red-light);
    color: var(--red);
    background: rgba(181, 52, 58, 0.06);
}
.scheme-card .card-actions .btn-delete:hover {
    background: rgba(181, 52, 58, 0.15);
}
.scheme-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    background: #faf8f5;
    border-radius: 12px;
    border: 1.5px dashed var(--border-light);
}
@media (max-width: 900px) {
    .scheme-card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .scheme-card-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   详情页头部
   ============================================================ */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.detail-header .detail-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--blue);
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1.5px solid var(--border-light);
    background: #fff;
    transition: all 0.25s ease;
    font-weight: 500;
    flex-shrink: 0;
}
.detail-header .detail-back-btn:hover {
    border-color: var(--blue);
    background: var(--blue-light);
    transform: translateX(-3px);
}
.detail-header .detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Noto Serif SC', serif;
    flex-shrink: 0;
}

/* ============================================================
   道具搜索下拉（奖励选择）
   ============================================================ */
.reward-item-select-wrap {
    position: relative;
}
.reward-item-select-wrap .dropdown-list {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    z-index: 60;
    display: none;
}
.reward-item-select-wrap .dropdown-list .option {
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.reward-item-select-wrap .dropdown-list .option:hover {
    background: var(--bg-hover);
}
.reward-item-select-wrap .dropdown-list .option.selected {
    background: #fdf4e2;
}

/* ============================================================
   微调
   ============================================================ */
.manage-subtab-sticky {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 1.5px solid var(--border);
}
#page-manage .m-toolbar-sticky {
    margin-top: 0;
    padding-top: 0.2rem;
}
#page-manage [id^="mtab-"] {
    padding-top: 0.5rem;
    margin-top: 0;
}
#page-more,
#func-detail-activity,
#func-detail-container,
#mcat-daily,
.more-cat-content {
    overflow: visible;
}
.daily-detail-content.hidden {
    display: none;
}
.daily-detail-content:not(.hidden) {
    display: block;
}

/* ============================================================
   棋子/火烧/苍龙等级 - 模块样式
   ============================================================ */

/* 卡片主体布局：左侧60%，右侧40% */
.il-team-body {
    display: flex;
    flex-direction: row;
    gap: 0;
    padding: 0;
}
.il-team-body .il-members-wrap {
    flex: 0 0 60%;
    min-width: 0;
    padding: 0.8rem 1rem 0.6rem 1rem;
    overflow-x: auto;
}
.il-team-body .il-sidebar {
    flex: 0 0 40%;
    min-width: 160px;
    background: #faf8f5;
    padding: 0.8rem 1rem 0.8rem 1rem;
    border-left: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 队伍卡片 */
.il-team-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
    padding: 0;
}
.il-team-card:hover {
    box-shadow: var(--shadow-md);
}

/* 卡片头部 */
.il-team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.2rem;
    background: #faf8f5;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 8px;
}
.il-team-header .team-name-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.il-team-header .team-name-input {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    border: none;
    background: transparent;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 80px;
    width: auto;
    font-family: var(--font-family);
}
.il-team-header .team-name-input:hover,
.il-team-header .team-name-input:focus {
    background: #fff;
    border: 1.5px solid var(--gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.10);
}
.il-team-header .team-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.il-team-header .team-actions .btn-del {
    color: var(--red);
    background: transparent;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.il-team-header .team-actions .btn-del:hover {
    background: rgba(181, 52, 58, 0.10);
}

/* 队员表格 */
.il-members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.il-members-table thead th {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.4rem;
    text-align: left;
    border-bottom: 2px solid var(--gold-light);
}
.il-members-table tbody td {
    padding: 0.35rem 0.4rem;
    border-bottom: 1px solid #f5f0e8;
    vertical-align: middle;
}
.il-members-table tbody tr:last-child td {
    border-bottom: none;
}
.il-members-table tbody tr:hover {
    background: rgba(200, 164, 92, 0.04);
}
.il-members-table .role-label {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    font-size: 0.85rem;
}
.il-members-table .role-select {
    min-width: 160px;
    max-width: 220px;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1.5px solid var(--border);
    background: var(--bg-input);
    transition: border-color 0.2s;
    width: 100%;
}
.il-members-table .role-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.12);
    outline: none;
}
.il-members-table .role-select:disabled {
    background: #f0ede8;
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}
.il-members-table .level-input {
    width: 60px;
    padding: 0.15rem 0.2rem;
    font-size: 0.85rem;
    text-align: center;
    border-radius: 4px;
    border: 1.5px solid var(--border);
    background: var(--bg-input);
    transition: border-color 0.2s;
}
.il-members-table .level-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.10);
    outline: none;
}
.il-members-table .level-input:disabled {
    background: #f0ede8;
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}
.il-members-table .edit-btn {
    font-size: 0.7rem;
    padding: 0.1rem 0.7rem;
    border-radius: 4px;
    border: 1.5px solid var(--blue-light);
    background: rgba(74, 111, 165, 0.06);
    color: var(--blue);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.il-members-table .edit-btn:hover {
    background: rgba(74, 111, 165, 0.15);
}
.il-members-table .edit-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 右侧边栏 */
.il-sidebar .il-quick-use {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}
.il-sidebar .il-quick-use input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gold);
    cursor: pointer;
    flex-shrink: 0;
}
.il-sidebar .il-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 2px 0;
}
.il-sidebar .il-info-item .label {
    font-weight: 500;
    color: var(--text-secondary);
}
.il-sidebar .il-info-item .value {
    font-weight: 600;
    color: var(--text-primary);
}
.il-sidebar .il-info-item .value .num {
    color: var(--red);
    font-weight: 700;
}
.il-sidebar .il-instance-input {
    width: 70px;
    padding: 0.15rem 0.2rem;
    font-size: 0.85rem;
    text-align: center;
    border-radius: 4px;
    border: 1.5px solid var(--border);
    background: var(--bg-input);
    transition: border-color 0.2s;
    font-weight: 600;
}
.il-sidebar .il-instance-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.10);
    outline: none;
}
.il-sidebar .il-instance-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.il-sidebar .il-instance-label .icon {
    font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 820px) {
    .il-team-body {
        flex-direction: column;
    }
    .il-team-body .il-members-wrap {
        flex: 1;
        padding: 0.6rem 0.8rem;
    }
    .il-team-body .il-sidebar {
        flex: 1;
        border-left: none;
        border-top: 1px solid var(--border-light);
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px 16px;
        padding: 0.6rem 0.8rem;
        background: #fcfaf7;
    }
    .il-team-body .il-sidebar .il-quick-use {
        border-bottom: none;
        padding-bottom: 0;
        flex: 1 1 100%;
    }
    .il-sidebar .il-info-item {
        flex: 0 1 auto;
        min-width: 100px;
    }
    .il-members-table .role-select {
        min-width: 120px;
        max-width: 160px;
    }
}
@media (max-width: 540px) {
    .il-members-table {
        font-size: 0.75rem;
    }
    .il-members-table tbody td {
        padding: 0.2rem 0.2rem;
    }
    .il-members-table .role-select {
        min-width: 90px;
        font-size: 0.7rem;
        padding: 0.1rem 0.3rem;
    }
    .il-members-table .level-input {
        width: 48px;
        font-size: 0.75rem;
    }
    .il-members-table .edit-btn {
        font-size: 0.6rem;
        padding: 0.05rem 0.4rem;
    }
    .il-team-header .team-name-input {
        font-size: 0.9rem;
        min-width: 60px;
    }
    .il-sidebar .il-instance-input {
        width: 56px;
        font-size: 0.75rem;
    }
    .il-sidebar .il-info-item {
        font-size: 0.75rem;
        min-width: 70px;
    }
    .il-team-body .il-sidebar {
        gap: 4px 10px;
        padding: 0.4rem 0.6rem;
    }
    .il-team-body .il-members-wrap {
        padding: 0.4rem 0.4rem;
    }
}

/* ===== 幸运几率风琴折叠 ===== */
.lucky-item-header {
    cursor: pointer;
    user-select: none;
}
.lucky-item-header:hover {
    background: #f5efe6 !important;
}
.lucky-level-header {
    cursor: pointer;
    user-select: none;
}
.lucky-level-header:hover {
    background: #f5efe6 !important;
}
.lucky-item-option {
    transition: background 0.1s;
}
.lucky-item-option:hover {
    background: #f0ebe0 !important;
}
/* 幸运几率折叠动画 */
.lucky-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.lucky-collapsible:not(.collapsed) {
    /* 展开时 max-height 由 JS 动态设置，这里不设固定值，由 JS 计算 */
}
.lucky-collapsible.collapsed {
    max-height: 0 !important;
}

/* 加载骨架动画 */
.skeleton-loading {
    animation: shimmer 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, #f0ede8 25%, #e5ddd0 50%, #f0ede8 75%);
    background-size: 200% 100%;
    border-radius: 6px;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

#cart-badge {
    display: none;  /* 默认隐藏，有数据时显示 */
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background: #ff4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0 4px;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 合成次数显示：强制一行排列，水平对齐 */
#synth-count-display {
    display: flex;
    flex-wrap: nowrap;      /* 强制不换行 */
    align-items: center;    /* 垂直居中 */
    gap: 6px;               /* 子元素间距（可选） */
    white-space: nowrap;    /* 额外保险，防止内部文字换行 */
    overflow: hidden;       /* 如果内容超出，隐藏溢出（可选） */
}

/* Tooltip 容器——使用 display + opacity + transform 实现平滑动画 */
.tooltip-container {
    position: fixed;
    z-index: var(--tooltip-z-index);
    background: var(--tooltip-bg);
    border: 1px solid var(--tooltip-border);
    border-radius: var(--tooltip-radius);
    padding: var(--space-md) var(--space-lg);
    max-width: var(--tooltip-max-width);
    min-width: var(--tooltip-min-width);
    box-shadow: var(--tooltip-shadow);
    
    /* ★ 动画核心 ★ */
    display: none;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition: 
        opacity 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

/* ★ 显示状态 ★ */
.tooltip-container.visible {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ★ 隐藏状态（完全不可见且不拦截事件） ★ */
.tooltip-container.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* 进入动画（仅当从 hidden 到 visible 时触发） */
.tooltip-container.visible {
    animation: tooltipSlideIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes tooltipSlideIn {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tooltipSlideOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(8px) scale(0.96); }
}

/* Tooltip 内部布局 */
.tooltip-container .tooltip-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-xs);
}

.tooltip-container .tooltip-body {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px var(--space-lg);
    font-size: var(--tooltip-font-size);
    color: var(--text-secondary);
}

.tooltip-container .tooltip-body .label {
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.tooltip-container .tooltip-body .value {
    color: var(--text-primary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

/* 触发元素——仅有光标提示，无下划线 */
.tooltip-trigger {
    cursor: help;
}

/* 响应式：小屏幕全宽 */
@media (max-width: 480px) {
    .tooltip-container {
        left: var(--space-md) !important;
        right: var(--space-md) !important;
        width: auto !important;
        max-width: none !important;
        min-width: auto !important;
    }
}

/* NPC类型按钮 */
.npc-type-btn {
    padding: 0.2rem 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    background: #fff;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.npc-type-btn:hover {
    border-color: var(--gold);
    background: var(--bg-hover);
}
.npc-type-btn.active {
    border-color: var(--jade-dark);
    background: var(--jade-dark);
    color: #fff;
}
/* 国家选择按钮 */
.country-btn {
    padding: 0.4rem 1.2rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.country-btn:hover {
    border-color: var(--gold);
    background: var(--bg-hover);
}
.country-btn.active {
    font-weight: 700;
}

.shop-subtab-btn {
    padding: 0.4rem 1.2rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.shop-subtab-btn:hover {
    background: rgba(200,164,92,0.08);
    color: var(--text-primary);
}
.shop-subtab-btn.active {
    color: var(--gold);
    background: linear-gradient(180deg, rgba(200,164,92,0.08) 0%, transparent 100%);
    font-weight: 700;
    border-bottom-color: var(--gold);
}

/* ============================================================
   三国币金额颜色（按数值范围分段）
   使用方式：<span class="coin-color-xxx">金额</span>
   或者通过 JS 动态设置 class
   ============================================================ */
.coin-low { color: var(--coin-low-color); }
.coin-blue { color: var(--coin-blue-color); }
.coin-green { color: var(--coin-green-color); }
.coin-orange { color: var(--coin-orange-color); }
.coin-pink { color: var(--coin-pink-color); }
.coin-red { color: var(--coin-red-color); }
.coin-negative { color: var(--coin-negative-color); }

/* 负数固定显示为红色（无论大小） */
.coin-negative { color: var(--coin-negative-color); }


/* 固定尺寸，防止悬停抖动 */
.lucky-quick-btn {
    flex-shrink: 0;          /* 防止被压缩 */
    min-width: 48px;         /* 统一最小宽度，避免因内容不同导致宽度变化 */
    padding: 0 12px;         /* 固定内边距，不随状态改变 */
    height: 34px;            /* 与 btn-sm 一致，保证高度固定 */
    line-height: 1;          /* 或保持默认 */
    border-width: 1.5px;     /* 固定边框宽度，与 .btn-outline 一致 */
}
/* 悬停状态只改变颜色和背景，不改变尺寸 */
.lucky-quick-btn:hover {
    transform: none !important;  /* 防止继承 .btn:active 或其他缩放 */
}

/* 三国币金额分段颜色（全局通用） */
.coin-color-low      { color: #3d3226; }          /* 小于 1 万（文本色） */
.coin-color-blue     { color: #2a5c8a; }          /* 1 万 ~ 10 万 */
.coin-color-green    { color: #2d7d46; }          /* 10 万 ~ 100 万 */
.coin-color-orange   { color: #e68a2e; }          /* 100 万 ~ 1000 万 */
.coin-color-pink     { color: #e84c8a; }          /* 1000 万 ~ 1 亿 */
.coin-color-red      { color: #dc3545; }          /* >= 1 亿 */
.coin-color-negative { color: #b5343a; }          /* 负数（红色） */

/* 每日收益侧边栏 */
.daily-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 80%;
    background: #faf8f5;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 2px solid var(--border);
}
.daily-sidebar.open {
    transform: translateX(0);
}

/* 手柄基础样式 */
.daily-sidebar-handle {
    position: fixed;
    left: 0;
    top: 24px;
    width: 110px;
    height: 36px;
    background: var(--red);
    color: #fff;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1001;
    transition: left 0.35s, background 0.2s;
    white-space: nowrap;
    padding: 0 12px;
}

/* 打开时手柄移到侧边栏内部右侧 */
.daily-sidebar-handle.inside {
    left: calc(80% - 130px);
    top: 12px;
    border-radius: 8px;
}

.active-task-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.active-task-item.selected {
    background: #f0ebe4;
    border-color: var(--gold-light);
}
.active-task-item .task-left-area { flex: 1; }
.active-task-item .task-name { font-weight: 600; }
.active-task-item .task-count-display { font-size: 0.8rem; color: var(--text-secondary); }

/* 进度条相关（确保覆盖侧边栏） */
.daily-sidebar .progress-wrapper {
    width: 100% !important;
    margin: 0 !important;
}

/* 每日收益模态框 */
.daily-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.daily-modal {
    background: #faf8f5;
    border-radius: var(--radius-xl);
    width: 90vw;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: fadeSlideIn 0.25s ease;
}
.daily-modal-left {
    width: 35%;
    border-right: 1px solid var(--border);
    padding: 16px;
    overflow-y: auto;
    background: var(--bg-card);
}
.daily-modal-right {
    padding: 16px;
    overflow-y: auto;
    background: var(--bg-card);
}
.daily-modal-right .active-task-item {
    margin-bottom: 6px;
}
.character-select-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 10px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.character-select-card:hover {
    background: #f5f0e8;
    border-color: var(--gold);
}
.character-select-card.selected {
    border-color: var(--gold);
    background: #fef9f0;
    box-shadow: 0 0 0 2px rgba(200, 164, 92, 0.2);
}

/* ========== 侧边栏模态框任务卡片（完全复用活跃度模块样式） ========== */
.daily-modal-right .active-task-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px 14px 18px;
    min-height: 76px;
    border: 1.5px solid var(--border-light);
    border-radius: 14px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin: 0;
}
.daily-modal-right .active-task-item:hover {
    border-color: var(--gold);
    box-shadow: 0 8px 30px rgba(200, 164, 92, 0.18);
    transform: translateY(-3px);
    background: #fdfcf9;
}
.daily-modal-right .active-task-item.selected {
    background: #fef9f0;
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(200, 164, 92, 0.25);
}
.daily-modal-right .active-task-item .task-left-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 0;
}
.daily-modal-right .active-task-item .task-top-row {
    display: flex;
    align-items: center;
    padding: 0;
}
.daily-modal-right .active-task-item .task-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
}
.daily-modal-right .active-task-item .task-date-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    margin-left: 4px;
}
.daily-modal-right .active-task-item .task-bottom-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
}
.daily-modal-right .active-task-item .task-count-display {
    /*font-size: 1rem;*/
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 52px;
    text-align: right;
    flex-shrink: 0;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}
.daily-modal-right .active-task-item .task-count-display.done {
    color: var(--jade-dark);
}
.daily-modal-right .active-task-item .task-count-display.partial {
    color: #b8860b;
}
.daily-modal-right .active-task-item .task-progress-wrapper {
    flex: 1;
    min-width: 40px;
}
.daily-modal-right .active-task-item .task-progress-bar {
    height: 16px;
    background: #f0ede8;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}
.daily-modal-right .active-task-item .task-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.daily-modal-right .active-task-item .task-active-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 6px rgba(255, 255, 255, 0.7);
    pointer-events: none;
    line-height: 1;
    z-index: 2;
    font-variant-numeric: tabular-nums;
}
/* ★ 按钮样式：方形，继承全局样式但覆盖圆角 */
.daily-modal-right .active-task-item .task-fav-btn {
    height: 100%;
    aspect-ratio: 1 / 1;
    flex: 0 0 auto;
    border-radius: 10px !important;      /* 方形 */
    border: 2px solid var(--border-light);
    background: #ffffff;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
    min-height: 44px;
    min-width: 44px;
}
.daily-modal-right .active-task-item .task-fav-btn:hover {
    border-color: var(--gold);
    background: linear-gradient(145deg, #fdf6e8, #f8edd6);
    color: var(--gold-dark);
    box-shadow: 0 4px 16px rgba(184, 134, 11, 0.20);
    transform: scale(1.03);
}
.daily-modal-right .active-task-item .task-fav-btn.active {
    border-color: #b5343a;
    background: linear-gradient(145deg, #fce8e8, #f5d6d6);
    color: #b5343a;
    box-shadow: 0 4px 16px rgba(181, 52, 58, 0.20);
}
.daily-modal-right .active-task-item .task-fav-btn.active:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 24px rgba(181, 52, 58, 0.30);
}

.item-option:hover { background: #f0f5ff; }

/* 装备管理卡片 */
.equip-card {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.35rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.equip-card:hover {
    border-color: var(--gold);
    color: var(--gold-dark);
}
.equip-card.active {
    background: var(--gold-light);
    border-color: var(--gold);
    color: var(--gold-dark);
    font-weight: 600;
}
/* 默认隐藏卸载按钮 */
#backpack-modal .unequip-btn {
    display: none;
}
/* 悬停槽位时显示 */
#backpack-modal .border.rounded:hover .unequip-btn {
    display: block;
}

/* ========== 新规则 道具/材料边框颜色 ========== */
.item-border-green .item-icon-sm {
    border: 2px solid var(--soul-green-border) !important;
}
.item-border-green .td-name-text {
    color: var(--soul-green-text);
}

.item-border-blue .item-icon-sm {
    border: 2px solid var(--soul-blue-border) !important;
}
.item-border-blue .td-name-text {
    color: var(--soul-blue-text);
}

.item-border-purple .item-icon-sm {
    border: 2px solid var(--soul-purple-border) !important;
}
.item-border-purple .td-name-text {
    color: var(--soul-purple-text);
}

/* 确保文字包装器可以继承颜色 */
.td-name-text {
    color: inherit;
}

/* ========== 新规则 操作按钮：删除/上移/下移（模态框内表格行） ========== */
.btn-delete {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    border: none;
    background: #e74c3c;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
    line-height: 1;
    transition: background 0.2s;
}
.btn-delete:hover {
    background: #c0392b;
}

.btn-move-up,
.btn-move-down {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: none;
    background: #ddd;
    color: #555;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}
.btn-move-up:hover,
.btn-move-down:hover {
    background: #bbb;
}

/* 操作列容器（让按钮水平排列） */
.action-btns {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    white-space: nowrap;
}

/* ========== 新规则 列表操作按钮：编辑/复制/删除 ========== */
.btn-edit {
    /* 保持原有的 ghost 风格，可单独再调整 */
}
.btn-copy {
    background: rgba(232,184,75,0.15);
    color: #b8860b;
    border: 1px solid rgba(232,184,75,0.25);
    border-radius: 6px;
    padding: 0.15rem 0.7rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.btn-copy:hover {
    background: rgba(232,184,75,0.25);
    border-color: rgba(232,184,75,0.5);
}

.detail-accordion-header {
    user-select: none;
    transition: background 0.2s;
}
.detail-accordion-header:hover {
    background: #f0e9da;
}
