/* Daggerheart (匕首之心) Epic Theme - Refined DnD Fantasy Style */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    /* Palette */
    --dh-primary-dark: #1a0b2e; /* Very dark purple */
    --dh-primary: #4b0082; /* Deep Purple */
    --dh-secondary: #2c3e50; /* Deep Slate Blue */
    --dh-accent-gold: #b8860b; /* Darker Gold for light background */
    --dh-accent-glow: #8b4513; /* Saddle Brown for highlights on light */
    --dh-text-main: #2c1a0b; /* Dark coffee/brown for text on parchment */
    --dh-text-muted: #5d4037; /* Muted brown */
    --dh-panel-bg: #fdf5e6; /* Old Lace / Parchment color */
    
    /* Gradients */
    --dh-bg-gradient: radial-gradient(circle at center, #2e0854 0%, #1a0b2e 60%, #0d0514 100%);
    --dh-card-gradient: linear-gradient(135deg, #fdf5e6 0%, #faebd7 100%);
    --dh-gold-gradient: linear-gradient(45deg, #b8860b, #daa520, #b8860b);
    
    /* Borders & Shadows */
    --dh-border-gold: 1px solid rgba(184, 134, 11, 0.4);
    --dh-box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --dh-glow-shadow: 0 0 10px rgba(184, 134, 11, 0.2);
    
    /* Typography */
    --dh-font-title: 'Cinzel', 'Times New Roman', serif;
    --dh-font-body: 'Playfair Display', 'Georgia', serif;
}

body.dh-theme {
    background: var(--dh-bg-gradient);
    background-attachment: fixed;
    color: var(--dh-text-main);
    font-family: var(--dh-font-body);
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
}

/* --- Container & Layout --- */
.dh-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* --- Typography --- */
.dh-header {
    text-align: left;
    margin-bottom: 10px;
    position: relative;
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--dh-accent-gold);
    min-height: 40px; /* Further reduced */
}

.dh-header h1 {
    font-family: var(--dh-font-title);
    font-size: 1.4rem; /* Smaller font */
    color: transparent;
    background: var(--dh-gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
    display: inline-block;
}

.dh-char-class-info {
    display: inline-block;
    margin-left: 15px;
    font-size: 0.9rem;
    color: #ffd700; /* Bright gold for better visibility */
    font-family: var(--dh-font-title);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.dh-header::after {
    display: none; /* Removed the line under centered header */
}

/* --- Cards (The Core Element) --- */
.dh-card, .dh-panel {
    background: var(--dh-card-gradient);
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 4px;
    padding: 25px;
    box-shadow: var(--dh-box-shadow);
    position: relative;
    transition: all 0.4s ease;
    overflow: hidden;
    color: var(--dh-text-main);
}

/* Gold Corners Decoration */
.dh-card::before, .dh-card::after,
.dh-panel::before, .dh-panel::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    transition: all 0.4s ease;
    pointer-events: none;
}

.dh-card::before, .dh-panel::before {
    top: 0;
    left: 0;
    border-top: 2px solid var(--dh-accent-gold);
    border-left: 2px solid var(--dh-accent-gold);
}

.dh-card::after, .dh-panel::after {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid var(--dh-accent-gold);
    border-right: 2px solid var(--dh-accent-gold);
}

.dh-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--dh-accent-gold);
}

/* Character Card Specifics */
.dh-char-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dh-char-name {
    font-family: var(--dh-font-title);
    font-size: 1.8rem;
    color: #5d4037;
    margin: 10px 0 5px;
    text-shadow: none;
}

.dh-char-class {
    color: var(--dh-text-muted);
    font-style: italic;
    font-size: 1rem;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

/* Stats Row */
.dh-char-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    width: 100%;
    padding: 15px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    background: rgba(0,0,0,0.03);
}

.dh-stat-item {
    text-align: center;
}

.dh-stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--dh-text-muted);
    margin-bottom: 4px;
}

.dh-stat-value {
    font-family: var(--dh-font-title);
    font-size: 1.5rem;
    color: var(--dh-text-main);
    font-weight: bold;
}

/* --- Buttons --- */
.dh-btn {
    background: linear-gradient(to bottom, #4b0082, #2e0854);
    color: #fff;
    border: 1px solid var(--dh-accent-gold);
    padding: 12px 30px;
    font-family: var(--dh-font-title);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.dh-btn:hover {
    box-shadow: 0 0 20px rgba(75, 0, 130, 0.4);
    transform: scale(1.05);
    background: linear-gradient(to bottom, #5a189a, #3c096c);
    color: var(--dh-accent-gold);
    border-color: var(--dh-accent-gold);
}

.dh-btn-tiny {
    background: var(--dh-primary);
    border: 1px solid var(--dh-accent-gold);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    cursor: pointer;
    font-family: var(--dh-font-title);
}

.dh-btn-tiny:hover {
    background: var(--dh-accent-gold);
    color: #fff;
}

/* --- Forms (Input & Select) --- */
.dh-input, .dh-select {
    background: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(184, 134, 11, 0.5) !important;
    color: var(--dh-text-main) !important;
    padding: 12px 15px !important;
    font-family: var(--dh-font-body) !important;
    font-size: 1rem !important;
    border-radius: 2px !important;
    transition: all 0.3s !important;
    width: 100%;
    box-sizing: border-box;
}

.dh-input:focus, .dh-select:focus {
    outline: none !important;
    border-color: #4b0082 !important;
    box-shadow: 0 0 10px rgba(75, 0, 130, 0.1) !important;
    background: #fff !important;
}

/* --- Scrollbar Customization --- */
::-webkit-scrollbar {
    width: 10px;
    background: #1a0b2e;
}

::-webkit-scrollbar-thumb {
    background: #4b0082;
    border-radius: 5px;
    border: 1px solid #1a0b2e;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a189a;
}

/* --- Index Page Adaptation (Login/Char Screen) --- */
.dh-theme #login-screen {
    background: transparent; /* Use body gradient */
}

.dh-theme .login-card {
    background: #fdf5e6;
    border: 2px solid var(--dh-accent-gold);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    color: var(--dh-text-main);
}

.dh-theme .login-card h2 {
    font-family: var(--dh-font-title);
    background: var(--dh-gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    text-shadow: none !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.dh-theme .login-card .brand-subtitle {
    border-bottom: 1px solid var(--dh-accent-gold);
    color: var(--dh-text-muted);
}

.dh-theme .login-card input {
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
}

.dh-theme .login-card button {
    background: linear-gradient(to bottom, #4b0082, #2e0854);
    border: 1px solid var(--dh-accent-gold);
    color: #fff;
}

/* Override Index Char Screen Elements */
.dh-theme .char-screen-header h2 {
    font-family: var(--dh-font-title);
    font-size: 3rem !important;
    background: var(--dh-gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    text-shadow: none !important;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.dh-theme .char-screen-header span {
    color: var(--dh-text-muted) !important;
    font-family: var(--dh-font-body);
}

/* Apply dh-panel style to the new char panel when in theme */
.dh-theme .sub-panel {
    background: #fdf5e6 !important;
    border: 1px solid rgba(184, 134, 11, 0.3) !important;
    border-left: 5px solid var(--dh-accent-gold) !important;
    box-shadow: var(--dh-box-shadow);
    color: var(--dh-text-main);
}

.dh-theme .sub-panel h4 span {
    border-bottom-color: var(--dh-accent-gold) !important;
    color: #5d4037;
    font-family: var(--dh-font-title);
}

.dh-theme .sub-panel input,
.dh-theme .sub-panel select {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #333 !important;
}

.dh-theme .sub-panel button {
    background: linear-gradient(to bottom, #4b0082, #2e0854) !important;
    border: 1px solid var(--dh-accent-gold) !important;
    color: #fff !important;
}

/* --- Resource Progress Bars --- */
.dh-resource-container {
    margin-bottom: 25px;
}

.dh-resource-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-family: var(--dh-font-title);
    color: #5d4037;
    font-weight: bold;
    font-size: 0.95rem;
}

.dh-resource-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dh-progress-bar {
    display: flex;
    gap: 4px;
    height: 18px;
    background: rgba(0,0,0,0.08);
    padding: 3px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex: 1;
}

.dh-progress-step {
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

.dh-progress-step.hp.active { background: #c0392b; box-shadow: 0 0 5px rgba(192, 57, 43, 0.4); }
.dh-progress-step.armor.active { background: #7f8c8d; box-shadow: 0 0 5px rgba(127, 140, 141, 0.4); }
.dh-progress-step.stress.active { background: #2980b9; box-shadow: 0 0 5px rgba(41, 128, 185, 0.4); }
.dh-progress-step.hope.active { background: #f39c12; box-shadow: 0 0 5px rgba(243, 156, 18, 0.4); }
.dh-progress-step.proficiency.active { background: #8e44ad; box-shadow: 0 0 5px rgba(142, 68, 173, 0.4); }

/* --- 重装奇幻风格阈值面板 (修正显示不全问题) --- */
.dh-thresholds-fantasy-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #efe4cf; /* 深色羊皮纸 */
    border: 2px solid #8b4513;
    padding: 15px 5px;
    border-radius: 4px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.2);
    margin: 25px 0;
    width: 100%;
    box-sizing: border-box;
}

.threshold-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0; /* 允许收缩 */
}

.node-label {
    font-family: var(--dh-font-title);
    font-weight: bold;
    color: #5d4037;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}

.node-sub {
    font-size: 0.65rem;
    color: #b8860b;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
}

.threshold-divider {
    flex: 0 0 50px; /* 固定输入框区域宽度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.fantasy-threshold-input {
    width: 45px;
    height: 35px;
    background: #fff !important;
    border: 1px solid #8b4513 !important;
    border-radius: 4px !important;
    text-align: center !important;
    font-size: 1.2rem !important;
    font-weight: bold !important;
    color: #2c1a0b !important;
    padding: 0 !important;
}

/* --- Attributes Grid --- */
.dh-attr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.dh-attr-box {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(184, 134, 11, 0.2);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 4px;
}

.dh-attr-label {
    font-size: 0.8rem;
    color: #8b4513;
    margin-bottom: 5px;
    font-weight: bold;
}

.dh-attr-input {
    width: 40px;
    background: transparent;
    border: none;
    color: #2c1a0b;
    font-size: 1.5rem;
    text-align: center;
    font-family: var(--dh-font-title);
    font-weight: bold;
    -moz-appearance: textfield;
    appearance: none;
}

/* 彻底隐藏所有数字输入框的上下箭头 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: none;
}

.dh-stat-input, .fantasy-threshold-input {
    -moz-appearance: textfield;
    appearance: none;
}

/* --- Equipment --- */
.dh-eq-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.dh-eq-slot {
    min-height: 40px;
    border: 1px dashed #b8860b;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.3);
    position: relative;
    border-radius: 3px;
    padding: 3px;
    box-sizing: border-box;
}

.dh-eq-item.compact {
    padding: 1px 4px;
    text-align: left;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.dh-eq-name {
    color: var(--dh-primary);
    font-weight: bold;
    font-size: 0.85rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 20px;
    cursor: pointer;
    line-height: 1.1;
}

.dh-eq-detail {
    font-size: 0.65rem !important;
    color: #5d4037;
    padding-left: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

.dh-unequip-btn {
    position: absolute;
    top: 50%;
    left: 2px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 2px;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dh-unequip-btn:hover {
    background: #c0392b;
}

.dh-eq-empty {
    color: rgba(184, 134, 11, 0.4);
    font-style: italic;
    font-size: 0.75rem !important;
}

.dh-inv-list {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.dh-inv-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* --- Domain Cards --- */
.dh-domain-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

@media (max-width: 1200px) {
    .dh-domain-cards-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

.dh-domain-card {
    background: #fffef0; /* Paper white */
    border: 1px solid #b8860b;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 180px; /* 改为最小高度，允许内容撑开 */
    width: 100%;
    box-sizing: border-box;
    color: #2c1a0b;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.dh-domain-card:hover { transform: scale(1.02); box-shadow: 0 6px 12px rgba(0,0,0,0.15); }

.dh-domain-card.active { border: 2px solid #4b0082; background: #fdf5e6; }

.dh-domain-card .card-title { color: #8b4513; font-weight: bold; margin-bottom: 5px; font-family: var(--dh-font-title); border-bottom: 1px solid rgba(139, 69, 19, 0.2); padding-bottom: 3px; }
.dh-domain-card .card-meta { font-size: 0.75rem; color: #5d4037; font-style: italic; margin-bottom: 8px; }
.dh-domain-card .card-desc { font-size: 0.9rem; line-height: 1.5; color: #2c1a0b; }
.dh-domain-card .card-desc-short { 
    font-size: 0.85rem; 
    color: #5d4037; 
    line-height: 1.4; 
    max-height: 80px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.dh-domain-card .card-desc-short p { margin: 0; }

.dh-card-slot-empty {
    border: 2px dashed rgba(184, 134, 11, 0.3);
    border-radius: 8px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8860b;
    font-style: italic;
    background: rgba(255, 255, 255, 0.1);
}

/* --- Modals --- */
.dh-modal {
    display: none;
    position: fixed;
    z-index: 2000; /* Higher base z-index */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

/* 自定义提示弹窗 (notice-overlay) */
.notice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

.notice-box {
    background: var(--dh-card-gradient);
    border: 2px solid var(--dh-accent-gold);
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative;
}

.notice-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--dh-primary);
    font-family: var(--dh-font-title);
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
    padding-bottom: 10px;
}

.notice-box .message {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: var(--dh-text-main);
    line-height: 1.6;
}

.notice-box .btn-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* 提示框按钮 */
.btn-success {
    background: linear-gradient(to bottom, #27ae60, #1e8449);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-danger {
    background: linear-gradient(to bottom, #c0392b, #922b21);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.btn-success:hover, .btn-danger:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#card-detail-modal {
    z-index: 3000; /* Card detail always on top of library */
}

.dh-modal-content {
    background: #fdf5e6; /* Old Lace */
    margin: 3% auto;
    padding: 20px;
    border: 3px solid #4b0082;
    width: 70%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    color: #2c1a0b;
    max-height: 85vh;
    overflow-y: auto;
}

.dh-modal-close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #4b0082;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* --- Library Modal Specific --- */
.library-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.library-top-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.library-main {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    min-height: 400px;
}

.library-left-tabs {
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    padding-right: 10px;
}

.dh-tab {
    padding: 10px 20px;
    background: #eee;
    border: 1px solid #ccc;
    color: #666;
    cursor: pointer;
    font-family: var(--dh-font-title);
    text-align: center;
    transition: all 0.2s;
    font-weight: bold;
}

.dh-tab.active {
    background: #4b0082;
    color: #fff;
    border-color: #4b0082;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

/* --- Card Detail Specific --- */
.card-detail-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.card-detail-header {
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 15px;
}

.card-detail-header h2 {
    font-family: var(--dh-font-title);
    color: #8b4513;
    margin: 0;
    font-size: 2rem;
}

.card-detail-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c1a0b;
}

.card-detail-body strong { color: #8b4513; }

.card-detail-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* 物品详情样式 */
.item-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.item-detail-row {
    display: flex;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    padding: 5px 0;
}

.item-detail-label {
    width: 100px;
    color: var(--dh-primary);
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.item-detail-value {
    flex: 1;
    color: var(--dh-text-main);
    font-size: 0.9rem;
    /* [Fix] 详情页值强制换行 */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* --- Markdown Overrides --- */
.dh-md-content h1, .dh-md-content h2 {
    color: #8b4513;
    font-family: var(--dh-font-title);
    margin: 12px 0 8px;
}

.dh-md-content h3 {
    font-size: 0.9rem;
    color: #666;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 3px;
    border-left: 3px solid #999;
    margin: 10px 0 5px;
    font-family: var(--dh-font-body); /* 备注功能使用正文字体更合适 */
    font-weight: bold;
}

.dh-md-content ul, .dh-md-content ol {
    padding-left: 20px;
}

.dh-md-content blockquote {
    border-left: 4px solid #b8860b;
    background: rgba(184, 134, 11, 0.05);
    margin: 10px 0;
    padding: 10px 20px;
    font-style: italic;
}

/* 悬停提示框 */
.dh-tooltip {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border: 1.5px solid var(--dh-accent-gold);
    border-radius: 4px;
    padding: 12px;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    pointer-events: none;
    display: none;
    font-size: 0.85rem;
    color: #333;
    line-height: 1.5;
    /* [Fix] 强制长文本换行 */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.dh-tooltip h4 {
    margin: 0 0 8px 0;
    color: var(--dh-primary);
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
    font-family: var(--dh-font-title);
}

.dh-tooltip .dh-md-content p {
    margin: 5px 0;
}

/* Section Title */
.section-title {
    font-family: var(--dh-font-title);
    font-size: 1.1rem;
    color: var(--dh-primary);
    border-bottom: 2px solid var(--dh-accent-gold);
    margin-bottom: 15px;
    padding-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dh-btn-small {
    background: var(--dh-primary);
    border: 1px solid var(--dh-accent-gold);
    color: #fff;
    width: 24px;
    height: 24px;
    padding: 0;
    cursor: pointer;
}

.dh-btn-text {
    background: transparent;
    border: none;
    color: #c0392b;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .dh-header h1 {
        font-size: 2.5rem;
    }
    
    .dh-container {
        padding: 20px 10px;
    }
}

/* --- 4-Column Layout & Compact Features --- */
.player-layout-4col {
    display: grid;
    grid-template-columns: 280px 340px 1fr 280px;
    grid-template-rows: min-content 1fr; /* Allow first row to size to content (Equipment), second takes rest (Ancestry) */
    gap: 12px;
    height: calc(100vh - 70px);
    overflow: hidden;
    padding-bottom: 45px;
}

/* Assign Grid Areas/Positions for Flattened Structure */
.col-1 { grid-column: 1; grid-row: 1 / span 2; }
#panel-equipment { grid-column: 2; grid-row: 1; margin-bottom: 12px; } /* Add margin for PC spacing */
#panel-ancestry { grid-column: 2; grid-row: 2; overflow-y: auto; } /* Ancestry takes remaining space */
.col-3 { grid-column: 3; grid-row: 1 / span 2; }
.col-4 { grid-column: 4; grid-row: 1 / span 2; }

@media (max-width: 1400px) {
    .player-layout-4col {
        display: flex;
        flex-wrap: wrap;
        height: auto;
        overflow: visible;
        gap: 20px;
    }
    .col-1, .col-3, .col-4 { width: 48%; height: 500px; }
    #panel-equipment, #panel-ancestry { width: 48%; }
}

@media (max-width: 800px) {
    .player-layout-4col {
        display: block !important;
        height: auto !important;
        padding-bottom: 80px !important;
        overflow: visible !important;
    }
    
    /* Hide all by default, shown by JS */
    .col-1, .col-3, .col-4, #panel-equipment, #panel-ancestry, #panel-experiences, #mobile-item-detail-panel, #mobile-inventory-panel {
        display: none !important;
        width: 100%;
        box-sizing: border-box; /* Ensure padding doesn't increase width */
        height: auto !important;
        overflow: visible !important;
    }

    /* Force consistent width for main mobile containers */
    .col-1, #panel-ancestry, #panel-equipment, #panel-experiences {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        margin-bottom: 20px !important; /* Add spacing between panels */
    }

    /* Drawer Mobile View - Fixed Box */
    .dh-drawer.mobile-view {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        border-top: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        margin-top: 20px !important;
        display: block !important;
    }
    
    .dh-drawer.mobile-view .drawer-handle {
        background: var(--dh-card-gradient) !important;
        border: 1px solid var(--dh-accent-gold) !important;
        border-bottom: none !important;
        border-radius: 4px 4px 0 0 !important;
        height: 35px !important;
        display: flex !important; /* Show handle (header) */
        cursor: default !important;
    }
    
    .dh-drawer.mobile-view .drawer-content {
        height: auto !important;
        max-height: none !important;
        background: rgba(255, 255, 255, 0.5) !important; 
        border: 1px solid var(--dh-accent-gold) !important;
        border-radius: 0 0 4px 4px !important;
        color: #000 !important;
        padding: 10px !important;
    }
    
    .dh-drawer.mobile-view .dh-inv-list-grid {
         grid-template-columns: 1fr 1fr !important; /* 2 columns */
         gap: 8px !important;
    }

    /* Adjust inventory item style for 2-column mobile layout */
    .dh-drawer.mobile-view .dh-inv-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 5px !important;
    }
    
    .dh-drawer.mobile-view .dh-inv-row span {
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .dh-drawer.mobile-view .dh-btn-small {
        width: 100% !important;
        text-align: center;
    }
}

.col-1, .col-3, .col-4 {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 2px;
    min-height: 0;
}

/* 隐藏所有列的滚动条但保持可滚动 */
.col-1::-webkit-scrollbar, 
.col-2::-webkit-scrollbar, 
.col-3::-webkit-scrollbar, 
.col-4::-webkit-scrollbar,
#class-features-container::-webkit-scrollbar {
    display: none;
}
.col-1, .col-2, .col-3, .col-4, #class-features-container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.dh-panel {
    flex-shrink: 0; /* Prevent panels from collapsing */
}

.compact-features .feature-block {
    border-bottom: 1px dashed rgba(184, 134, 11, 0.2);
    padding: 8px 0;
}

.compact-features .feature-block:last-child {
    border-bottom: none;
}

.compact-features .feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.compact-features .feature-name {
    font-weight: bold;
    color: #8b4513; /* Darker brown for better readability */
    font-size: 0.95rem;
    font-family: var(--dh-font-title);
}

.compact-features .feature-desc {
    font-size: 0.85rem;
    color: #333; /* Pure dark gray for best readability */
    line-height: 1.4;
}

.dh-md-content p { margin: 4px 0; }
.dh-md-content strong { color: #4b0082; font-weight: bold; }
.dh-tooltip .dh-md-content strong { color: var(--dh-primary); font-weight: bold; }

/* [Fix] 全局 Markdown 内容强制换行 */
.dh-md-content {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* --- Bottom Drawer --- */
.dh-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #1a0b2e;
    border-top: 2px solid var(--dh-accent-gold);
    z-index: 1000;
    transition: transform 0.3s ease;
    transform: translateY(calc(100% - 40px));
}

.dh-drawer.open {
    transform: translateY(0);
}

.drawer-handle {
    height: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    font-family: var(--dh-font-title);
    color: var(--dh-accent-gold);
    font-weight: bold;
}

.drawer-content {
    height: 250px;
    padding: 15px;
    overflow-y: auto;
    background: rgba(0,0,0,0.3);
    color: #fff; /* Ensure text visibility in drawer */
}

/* --- Mobile Tab Navigation (Fixed Bottom) --- */
.dh-mobile-nav {
    display: none; /* Default hidden on PC */
}

/* --- Mobile Tab Navigation (Fixed Bottom) --- */
.dh-mobile-nav {
    display: none; /* Default hidden on PC */
}

@media (max-width: 800px) {
    .dh-mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: #1a0b2e; /* Dark theme bg */
        border-top: 2px solid var(--dh-accent-gold);
        z-index: 9000;
        justify-content: space-around;
        padding: 0;
        height: 60px;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.5);
    }

    .dh-mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: #8b7d6b; /* Unselected color */
        font-family: var(--dh-font-title);
        font-size: 0.8rem;
        cursor: pointer;
        transition: all 0.2s;
        background: transparent;
        border: none;
        padding: 5px 0;
    }

    .dh-mobile-nav-item.active {
        color: var(--dh-accent-gold);
        background: rgba(184, 134, 11, 0.1);
        border-top: 3px solid var(--dh-accent-gold);
    }

    .dh-mobile-nav-item i {
        font-size: 1.2rem;
        margin-bottom: 3px;
    }

    /* Single column for equipment on mobile */
    .dh-eq-slots {
        grid-template-columns: 1fr; 
    }
}

/* --- End of File --- */

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

.dh-inv-row {
    background: #fff; /* Solid white background */
    color: #000; /* Solid black text */
    padding: 8px 12px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--dh-accent-gold);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.dh-inv-row span {
    font-weight: bold;
}

.dh-inv-count {
    color: #c0392b; /* 使用一种显眼的红色/深红 */
    font-weight: 800;
    margin-left: 6px;
    font-size: 0.95rem;
    font-family: 'Cinzel', serif;
}

.dh-tag-equipped {
    background: var(--dh-primary);
    color: #fff;
    font-size: 0.65rem;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 5px;
    font-family: var(--dh-font-title);
    font-weight: bold;
    vertical-align: middle;
}

.dh-inv-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

/* --- Domain Tags --- */
.dh-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dh-card-tag {
    background: #fff;
    border: 1px solid var(--dh-accent-gold);
    color: var(--dh-text-main);
    padding: 8px 6px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    border-radius: 4px; /* More blocky but still rounded */
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--dh-font-title);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: visible;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

/* 回想徽章 - 紫色对话气泡 */
.dh-recall-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 20px;
    background: linear-gradient(135deg, #7b2cbf 0%, #9d4edd 50%, #7b2cbf 100%);
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    font-family: var(--dh-font-title);
    border-radius: 12px;
    box-shadow: 
        0 2px 4px rgba(123, 44, 191, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    position: relative;
    border: 1.5px solid rgba(157, 78, 221, 0.5);
}

/* 对话气泡的小尾巴 */
.dh-recall-badge::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 4px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 0px solid transparent;
    border-top: 5px solid #7b2cbf;
    filter: drop-shadow(0 1px 1px rgba(123, 44, 191, 0.3));
}

/* 气泡内的高光效果 */
.dh-recall-badge::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 4px;
    right: 4px;
    height: 6px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

.dh-card-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dh-card-tag:hover {
    background: var(--dh-accent-gold);
    color: #fff;
    transform: translateY(-2px);
}

.dh-card-tag.active {
    border-color: var(--dh-primary);
    background: #4b0082;
    color: #fff;
}

.dh-card-tag-empty {
    border: 1px dashed rgba(184, 134, 11, 0.3);
    padding: 6px 4px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

.h-full { height: 100%; }
/* 鎵嬫満绔紭鍖?- 甯傚満椤甸潰 */
@media (max-width: 768px) {
    .market-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    .market-sidebar {
        flex-direction: row !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding-bottom: 5px !important;
        border-bottom: 1px solid rgba(184, 134, 11, 0.3) !important;
        margin-bottom: 10px !important;
        gap: 10px !important;
    }

    .market-sidebar .dh-tab {
        flex: 0 0 auto !important;
        padding: 8px 16px !important;
        margin-bottom: 0 !important;
        border-radius: 20px !important;
        font-size: 0.9rem !important;
    }
    
    .market-sidebar .dh-btn {
        white-space: nowrap !important;
        padding: 8px 16px !important;
        border-radius: 20px !important;
        margin-top: 0 !important;
        flex: 0 0 auto !important;
        width: auto !important; /* 覆盖原来的 width: 100% */
    }

    /* 顶部增加返回按钮 - 手机端优化布局 */
    .dh-header {
        display: flex !important;
        flex-direction: row !important; /* 改为横向排列 */
        align-items: center !important;
        justify-content: flex-start !important; /* 左对齐 */
        gap: 10px !important;
        position: relative !important;
        padding: 5px 10px !important; /* 缩小整体内边距 */
        min-height: 50px !important; /* 减小最小高度 */
    }

    /* 返回按钮容器放到最左边 */
    .dh-header > div:last-child {
        order: -1 !important;
    }

    /* 角色名容器 */
    .dh-header > div:first-child {
        display: flex !important;
        flex-direction: row !important;
        align-items: baseline !important;
        gap: 8px !important;
        overflow: hidden; /* 防止名字太长撑开 */
    }

    .dh-char-name {
        font-size: 1.1rem !important; /* 缩小名字字体 */
        margin: 0 !important;
        white-space: nowrap !important;
    }

    .dh-char-class-info {
        font-size: 0.8rem !important; /* 缩小信息字体 */
        color: #666 !important;
        white-space: nowrap !important;
    }
    
    /* 鎼滅储鏍忎紭鍖?*/
    .dh-panel[style*="flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }
    
    .dh-panel input, .dh-panel select {
        width: 100% !important;
    }

    /* 鍟嗗搧鍒楄〃鍙屽垪鏄剧ず */
    .market-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .item-card {
        padding: 10px !important;
    }

    .item-name {
        font-size: 1rem !important;
    }

.item-desc {
    font-size: 0.8rem !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* [Fix] 市场描述强制换行 */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}
    
    /* 璐拱寮圭獥閫傞厤 */
    .dh-modal-content {
        width: 92% !important;
        max-width: 92% !important;
        padding: 15px 12px !important;
        margin: 2% auto !important;
        max-height: 90vh !important;
    }
    
    /* 市场物品详情弹窗 */
    .item-detail-modal-content {
        width: 92% !important;
        max-width: 92% !important;
        padding: 12px 10px !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
    }
    
    .item-detail-modal-content .section-title {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }
    
    .item-detail-modal-content .item-detail-grid {
        font-size: 0.8rem !important;
        margin-bottom: 8px !important;
    }
    
    .item-detail-modal-content .item-detail-row {
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 5px 0 !important;
        border-bottom: 1px dashed rgba(139, 69, 19, 0.2) !important;
    }
    
    .item-detail-modal-content .item-detail-label {
        width: auto !important;
        font-size: 0.8rem !important;
        font-weight: bold !important;
        color: #8b4513 !important;
    }
    
    .item-detail-modal-content .item-detail-value {
        font-size: 0.8rem !important;
        text-align: right !important;
    }
    
    .item-detail-modal-content .dh-md-content {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
    }
    
    .item-detail-modal-content .dh-md-content p {
        margin: 6px 0 !important;
    }
    
    .item-detail-modal-content .dh-md-content strong {
        font-size: 0.8rem !important;
    }
    
    .item-detail-modal-content h4 {
        font-size: 0.9rem !important;
        margin-bottom: 6px !important;
        margin-top: 8px !important;
    }
    
    .item-detail-modal-content .dh-btn {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        margin-top: 10px !important;
    }
    
    /* 购买弹窗适配 */
    #purchase-modal .dh-modal-content {
        width: 92% !important;
        max-width: 92% !important;
        padding: 12px 10px !important;
    }
    
    #purchase-modal .section-title {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }
    
    #purchase-modal select,
    #purchase-modal .dh-btn {
        font-size: 0.85rem !important;
        padding: 8px !important;
    }
    
    #purchase-modal label {
        font-size: 0.85rem !important;
        margin-bottom: 4px !important;
    }
    
    /* 族裔与社群弹窗适配 */
    .ancestry-modal-content {
        width: 92% !important;
        max-width: 92% !important;
        padding: 12px 10px !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
    }
    
    .ancestry-modal-content .section-title {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }
    
    .ancestry-modal-content .form-group {
        margin-bottom: 10px !important;
    }
    
    .ancestry-modal-content label {
        font-size: 0.8rem !important;
        margin-bottom: 3px !important;
    }
    
    .ancestry-modal-content select {
        font-size: 0.85rem !important;
        padding: 6px !important;
    }
    
    .ancestry-modal-content .dh-md-content {
        font-size: 0.7rem !important;
        max-height: 80px !important;
        overflow-y: auto !important;
        line-height: 1.3 !important;
    }
    
    .ancestry-modal-content .dh-btn {
        font-size: 0.85rem !important;
        padding: 8px 12px !important;
    }
    
    /* 手机端经历输入框优化 */
    .experience-item input[type="text"] {
        min-width: 0 !important;
        font-size: 0.85rem !important;
    }
    
    .experience-item input[type="number"] {
        width: 45px !important;
        font-size: 0.8rem !important;
        padding: 4px !important;
    }
    
    /* 手机端领域相关弹窗适配 */
    #library-modal .dh-modal-content {
        width: 92% !important;
        max-width: 92% !important;
        padding: 10px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    
    #library-modal .section-title {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }
    
    #library-modal .library-layout {
        display: flex !important;
        flex-direction: column !important;
    }
    
    #library-modal .library-top-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        margin-bottom: 10px !important;
    }
    
    #library-modal .library-top-tabs button {
        font-size: 0.75rem !important;
        padding: 6px 10px !important;
    }
    
    #library-modal .library-main {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    #library-modal .library-left-tabs {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        border-right: none !important;
        padding-right: 0 !important;
        margin-bottom: 8px !important;
    }
    
    #library-modal .library-left-tabs button {
        font-size: 0.7rem !important;
        padding: 5px 8px !important;
    }
    
    #library-modal .dh-tab {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
        flex: 0 0 auto !important;
    }
    
    #library-modal .library-grid {
        grid-template-columns: 1fr !important;
        max-height: 50vh !important;
        gap: 8px !important;
    }
    
    #library-modal .dh-domain-card {
        height: auto !important;
        min-height: 100px !important;
        padding: 8px !important;
        font-size: 0.75rem !important;
    }
    
    #library-modal .dh-domain-card h3 {
        font-size: 0.9rem !important;
        margin-bottom: 4px !important;
    }
    
    /* 卡片详情弹窗适配 */
    #card-detail-modal .dh-modal-content {
        width: 92% !important;
        max-width: 92% !important;
        padding: 12px 10px !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
    }
    
    #card-detail-modal .section-title {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }
    
    #card-detail-modal .card-detail-view {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }
    
    #card-detail-modal .dh-md-content {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
    }
    
    #card-detail-modal .dh-md-content p {
        margin: 6px 0 !important;
    }
    
    #card-detail-modal .card-detail-footer {
        margin-top: 10px !important;
        padding-top: 10px !important;
    }
    
    #card-detail-modal .card-detail-footer .dh-btn {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }
    
    /* 物品详情弹窗适配（player页面） */
    #item-detail-modal .dh-modal-content {
        width: 92% !important;
        max-width: 92% !important;
        padding: 12px 10px !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
    }
    
    #item-detail-modal .section-title {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }
    
    #item-detail-modal .item-detail-grid {
        font-size: 0.8rem !important;
        margin-bottom: 8px !important;
    }
    
    #item-detail-modal .item-detail-row {
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 5px 0 !important;
        border-bottom: 1px dashed rgba(139, 69, 19, 0.2) !important;
    }
    
    #item-detail-modal .item-detail-label {
        width: auto !important;
        font-size: 0.8rem !important;
        font-weight: bold !important;
        color: #8b4513 !important;
    }
    
    #item-detail-modal .item-detail-value {
        font-size: 0.8rem !important;
        text-align: right !important;
    }
    
    #item-detail-modal .dh-md-content {
        font-size: 0.75rem !important;
        line-height: 1.3 !important;
    }
    
    #item-detail-modal .dh-md-content p {
        margin: 6px 0 !important;
    }
    
    #item-detail-modal h4 {
        font-size: 0.9rem !important;
        margin: 8px 0 6px 0 !important;
    }
    
    /* 其他弹窗适配 */
    #choice-modal .dh-modal-content,
    #subclass-modal .dh-modal-content,
    #multiclass-modal .dh-modal-content,
    #mc-subclass-modal .dh-modal-content,
    #add-domain-modal .dh-modal-content,
    #limit-modal .dh-modal-content {
        width: 92% !important;
        max-width: 92% !important;
        padding: 12px 10px !important;
        max-height: 88vh !important;
        overflow-y: auto !important;
    }
    
    #choice-modal .section-title,
    #subclass-modal .section-title,
    #multiclass-modal .section-title,
    #mc-subclass-modal .section-title,
    #add-domain-modal .section-title,
    #limit-modal .section-title {
        font-size: 1rem !important;
        margin-bottom: 10px !important;
    }
    
    #subclass-modal .dh-grid,
    #multiclass-modal .dh-grid,
    #mc-subclass-modal .dh-grid,
    #add-domain-modal .dh-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    /* 手机端领域卡展开显示 */
    @media (max-width: 800px) {
        #active-domain-cards .dh-domain-card {
            padding: 15px !important;
            margin-bottom: 15px !important;
            height: auto !important;
            min-height: auto !important;
        }
        
        #active-domain-cards .card-title {
            font-size: 1rem !important;
            margin-bottom: 6px !important;
        }
        
        #active-domain-cards .card-meta {
            font-size: 0.7rem !important;
            margin-bottom: 8px !important;
        }
        
        #active-domain-cards .card-desc {
            font-size: 0.85rem !important;
            line-height: 1.5 !important;
            max-height: none !important;
            overflow: visible !important;
        }
        
        #active-domain-cards .card-desc p {
            margin: 0.5em 0 !important;
        }
        
        /* 手机端回想气泡稍微大一点 */
        .dh-recall-badge {
            width: 28px !important;
            height: 22px !important;
            font-size: 0.75rem !important;
        }
        
        .dh-recall-badge::before {
            bottom: -5px !important;
            left: 5px !important;
            border-left: 6px solid transparent !important;
            border-top: 6px solid #7b2cbf !important;
        }
        
        .dh-card-tag {
            padding: 8px 6px !important;
            font-size: 0.9rem !important;
        }
    }
    
    /* 禁用手机端鼠标悬浮效果 */
    @media (hover: none) and (pointer: coarse) {
        .dh-card:hover,
        .dh-domain-card:hover,
        .dh-card-tag:hover,
        .dh-inv-row:hover,
        .item-card:hover,
        .unified-card:hover,
        .dh-btn:hover,
        .dh-btn-tiny:hover,
        .nav-item:hover {
            transform: none !important;
            box-shadow: inherit !important;
            filter: none !important;
            background: inherit !important;
        }
        
        /* 禁用tooltip */
        .dh-tooltip {
            display: none !important;
            pointer-events: none !important;
            visibility: hidden !important;
        }
    }
    
    /* 全局强制禁用触摸设备的tooltip */
    @media (pointer: coarse) {
        .dh-tooltip {
            display: none !important;
            pointer-events: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
        }
    }
}

/* --- 冒险记录页面样式 --- */
.adventure-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.adventure-header {
    background: var(--dh-card-gradient);
    border: 2px solid var(--dh-accent-gold);
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--dh-box-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.adventure-header::before,
.adventure-header::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    transition: all 0.4s ease;
    pointer-events: none;
}

.adventure-header::before {
    top: 0;
    left: 0;
    border-top: 2px solid var(--dh-accent-gold);
    border-left: 2px solid var(--dh-accent-gold);
}

.adventure-header::after {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid var(--dh-accent-gold);
    border-right: 2px solid var(--dh-accent-gold);
}

.adventure-header h1 {
    margin: 0;
    color: transparent;
    background: var(--dh-gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    font-size: 2rem;
    font-family: var(--dh-font-title);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.adventure-header p {
    margin: 8px 0 0 0;
    color: var(--dh-text-muted);
    font-size: 1rem;
}

.back-btn {
    background: linear-gradient(to bottom, #4b0082, #2e0854);
    border: 1px solid var(--dh-accent-gold);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--dh-font-title);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.back-btn:hover {
    background: linear-gradient(to bottom, #5a189a, #3c096c);
    color: var(--dh-accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(75, 0, 130, 0.4);
}

.search-bar {
    background: var(--dh-card-gradient);
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: var(--dh-box-shadow);
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(184, 134, 11, 0.5);
    border-radius: 2px;
    font-size: 1rem;
    font-family: var(--dh-font-body);
    color: var(--dh-text-main);
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #4b0082;
    box-shadow: 0 0 10px rgba(75, 0, 130, 0.2);
    background: #fff;
}

.adventures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.adventure-card {
    background: var(--dh-card-gradient);
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--dh-box-shadow);
    transition: all 0.4s ease;
    position: relative;
}

.adventure-card::before,
.adventure-card::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    transition: all 0.4s ease;
    pointer-events: none;
}

.adventure-card::before {
    top: 0;
    left: 0;
    border-top: 2px solid var(--dh-accent-gold);
    border-left: 2px solid var(--dh-accent-gold);
}

.adventure-card::after {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid var(--dh-accent-gold);
    border-right: 2px solid var(--dh-accent-gold);
}

.adventure-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--dh-accent-gold);
}

.adventure-card-header {
    background: rgba(0,0,0,0.03);
    padding: 20px;
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
}

.adventure-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #8b4513;
    margin: 0 0 8px 0;
    font-family: var(--dh-font-title);
}

.adventure-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--dh-text-muted);
    margin-top: 10px;
}

.adventure-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--dh-font-body);
}

.adventure-description {
    color: var(--dh-text-muted);
    font-size: 0.95rem;
    margin-top: 8px;
    line-height: 1.5;
}

.adventure-note {
    background: rgba(184, 134, 11, 0.05);
    border-left: 4px solid var(--dh-accent-gold);
    padding: 12px 15px;
    margin: 15px 20px;
    border-radius: 4px;
}

.adventure-note-title {
    font-size: 0.85rem;
    color: var(--dh-accent-gold);
    font-weight: 600;
    margin-bottom: 5px;
    font-family: var(--dh-font-title);
}

.adventure-note-content {
    color: var(--dh-text-main);
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

.members-section {
    padding: 20px;
}

.members-title {
    font-size: 1rem;
    color: #8b4513;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--dh-font-title);
}

.members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.member-tag {
    background: linear-gradient(to bottom, #4b0082, #2e0854);
    border: 1px solid var(--dh-accent-gold);
    color: #fff;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(75, 0, 130, 0.3);
    transition: all 0.3s;
    font-family: var(--dh-font-body);
}

.member-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(75, 0, 130, 0.5);
    background: linear-gradient(to bottom, #5a189a, #3c096c);
}

.member-char-name {
    font-weight: 600;
}

.member-username {
    opacity: 0.8;
    font-size: 0.85rem;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: var(--dh-card-gradient);
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 4px;
    box-shadow: var(--dh-box-shadow);
}

.empty-state-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 1.5rem;
    color: #8b4513;
    margin-bottom: 10px;
    font-family: var(--dh-font-title);
}

.empty-state-text {
    font-size: 1rem;
    color: var(--dh-text-muted);
}

/* 冒险记录页面响应式 */
@media (max-width: 768px) {
    .adventure-container {
        padding: 10px;
    }

    .adventure-header {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .adventure-header h1 {
        font-size: 1.5rem;
    }

    .adventures-grid {
        grid-template-columns: 1fr;
    }

    .adventure-card {
        margin-bottom: 10px;
    }

    .members-list {
        gap: 8px;
    }

    .member-tag {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

