/**
 * DC Inside 風格覆寫（日間預設 + 夜間 .dci-night）
 * 套用於 html.fate-theme-dci 或 body.fate-theme-dci
 */

html.fate-theme-dci,
body.fate-theme-dci {
    --dci-topbar: #3b4890;
    --dci-topbar-fg: #fff;
    --dci-topbar-link: #dce4ff;
    --dci-border: #ccc;
    --dci-border-soft: #ddd;
    --dci-link: #0066cc;
    --dci-link-hover: #004499;
    --dci-btn-bg: #f5f5f5;
    --dci-btn-border: #bbb;
    --bg: #ececec;
    --bg2: #f5f5f5;
    --fg: #333;
    --muted: #666;
    --accent: #0066cc;
    --accent2: #3b4890;
    --ok: #22863a;
    --line: #ccc;
    --card: #fff;
    --radius: 4px;
    --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.04);
    --shadow-panel: 0 1px 2px rgba(0, 0, 0, 0.06);
}

html.fate-theme-dci.dci-night,
body.fate-theme-dci.dci-night {
    --dci-topbar: #2a3159;
    --dci-topbar-fg: #e8eaf5;
    --dci-topbar-link: #b8c4f0;
    --dci-border: #444;
    --dci-border-soft: #3a3a3a;
    --dci-link: #6eb3ff;
    --dci-link-hover: #9ecfff;
    --dci-btn-bg: #2a2a2a;
    --dci-btn-border: #555;
    --bg: #1e1e1e;
    --bg2: #262626;
    --fg: #e0e0e0;
    --muted: #999;
    --accent: #6eb3ff;
    --accent2: #8fa4ff;
    --line: #444;
    --card: #2a2a2a;
    --shadow-sm: none;
    --shadow-panel: none;
}

html.fate-theme-dci body,
body.fate-theme-dci.forum-body {
    background: var(--bg);
    color: var(--fg);
    letter-spacing: 0;
    -webkit-font-smoothing: auto;
}

/* ── 頂欄 ── */
html.fate-theme-dci .topbar,
body.fate-theme-dci .topbar {
    background: var(--dci-topbar);
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    backdrop-filter: none;
}

html.fate-theme-dci .topbar-inner,
body.fate-theme-dci .topbar-inner {
    max-width: 1100px;
    padding: 0.55rem 0.85rem;
    gap: 0.45rem 0.75rem;
}

html.fate-theme-dci .brand,
body.fate-theme-dci .brand {
    color: var(--dci-topbar-fg);
    letter-spacing: 0.06em;
    font-size: 0.92rem;
}

html.fate-theme-dci .brand span,
body.fate-theme-dci .brand span {
    color: #a8b8ff;
    font-weight: 600;
}

html.fate-theme-dci .topbar nav,
body.fate-theme-dci .topbar nav {
    font-size: 0.84rem;
}

html.fate-theme-dci .topbar nav a,
body.fate-theme-dci .topbar nav a {
    color: var(--dci-topbar-link);
    text-decoration: none;
}

html.fate-theme-dci .topbar nav a:hover,
body.fate-theme-dci .topbar nav a:hover {
    color: #fff;
    text-decoration: underline;
}

html.fate-theme-dci .dci-night-toggle,
body.fate-theme-dci .dci-night-toggle {
    margin-left: auto;
    flex-shrink: 0;
    font: inherit;
    font-size: 0.78rem;
    padding: 0.28rem 0.55rem;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: var(--dci-topbar-fg);
    cursor: pointer;
    line-height: 1.2;
}

html.fate-theme-dci .dci-night-toggle:hover,
body.fate-theme-dci .dci-night-toggle:hover {
    background: rgba(255, 255, 255, 0.22);
}

html.fate-theme-dci .topbar nav,
body.fate-theme-dci .topbar nav {
    margin-left: 0;
}

/* 有夜間按鈕時 nav 仍靠右 */
html.fate-theme-dci .topbar-inner:has(.dci-night-toggle) nav,
body.fate-theme-dci .topbar-inner:has(.dci-night-toggle) nav {
    margin-left: auto;
}

/* ── 版型 ── */
html.fate-theme-dci .layout-shell,
body.fate-theme-dci .layout-shell {
    max-width: 1100px;
    padding: 0 0.85rem;
}

html.fate-theme-dci .layout,
body.fate-theme-dci .layout {
    gap: 0.85rem;
}

/* ── 卡片／面板 ── */
html.fate-theme-dci .sidebar-card,
html.fate-theme-dci .hero,
html.fate-theme-dci .store-panel,
html.fate-theme-dci .store-card-fate,
html.fate-theme-dci .fate-weekly-hero,
html.fate-theme-dci .card,
html.fate-theme-dci .member-profile-panel,
body.fate-theme-dci .sidebar-card {
    background: var(--card);
    border: 1px solid var(--dci-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

html.fate-theme-dci .card {
    overflow: hidden;
}

html.fate-theme-dci .card:hover {
    border-color: var(--accent);
}

html.fate-theme-dci .card-body h2 a:hover {
    color: var(--accent);
}

html.fate-theme-dci .card-foot a {
    color: var(--dci-link);
}

html.fate-theme-dci .fate-weekly-hero {
    margin-bottom: 0.85rem;
}

html.fate-theme-dci .fate-weekly-hero__badge,
html.fate-theme-dci .fate-weekly-hero__rank {
    border-radius: 3px;
}

html.fate-theme-dci .toolbar {
    background: var(--card);
    border: 1px solid var(--dci-border);
    border-radius: var(--radius);
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.85rem;
}

html.fate-theme-dci .grid {
    gap: 0.65rem;
}

html.fate-theme-dci .hero {
    padding: 1rem 1.05rem;
    margin-bottom: 0.85rem;
}

html.fate-theme-dci .hero p.lead {
    color: var(--muted);
    font-size: 0.88rem;
}

html.fate-theme-dci .fate-search-summary {
    border: 1px solid var(--dci-border-soft);
    border-radius: var(--radius);
    background: var(--bg2);
    padding: 0.65rem 0.75rem;
    margin-bottom: 0.75rem;
}
html.fate-theme-dci .text-accent-link,
html.fate-theme-dci a:not([class]) {
    color: var(--dci-link);
}

html.fate-theme-dci .text-accent-link:hover {
    color: var(--dci-link-hover);
}

/* 側欄 */
html.fate-theme-dci .sidebar-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--fg);
    border-bottom: 1px solid var(--dci-border-soft);
    padding-bottom: 0.45rem;
    margin-bottom: 0.65rem;
}

html.fate-theme-dci .sidebar-btn {
    background: var(--dci-btn-bg);
    border: 1px solid var(--dci-btn-border);
    color: var(--fg);
    border-radius: 3px;
    font-weight: 500;
}

html.fate-theme-dci .sidebar-btn:hover {
    background: #e8e8e8;
    border-color: #999;
}

html.fate-theme-dci.dci-night .sidebar-btn:hover {
    background: #333;
}

html.fate-theme-dci .sidebar-btn--ghost {
    background: transparent;
}

html.fate-theme-dci .sidebar-search,
html.fate-theme-dci select,
html.fate-theme-dci input[type="search"],
html.fate-theme-dci input[type="text"],
html.fate-theme-dci input[type="email"],
html.fate-theme-dci input[type="password"],
html.fate-theme-dci input[type="number"],
html.fate-theme-dci textarea {
    background: var(--card);
    border: 1px solid var(--dci-border);
    color: var(--fg);
    border-radius: 3px;
}

html.fate-theme-dci .sidebar-submit,
html.fate-theme-dci .btn-link,
html.fate-theme-dci .store-toolbar .btn-link {
    background: var(--dci-btn-bg);
    border: 1px solid var(--dci-btn-border);
    color: var(--fg);
    border-radius: 3px;
}

html.fate-theme-dci .sidebar-submit:hover,
html.fate-theme-dci .btn-link:hover {
    background: #e0e0e0;
    border-color: #999;
}

html.fate-theme-dci.dci-night .sidebar-submit:hover,
html.fate-theme-dci.dci-night .btn-link:hover {
    background: #383838;
}

/* 週榜 */
html.fate-theme-dci .fate-weekly-hero__nav {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.35);
}

html.fate-theme-dci .fate-weekly-hero__dot {
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* 店家詳情 */
html.fate-theme-dci .store-card-fate {
    border-radius: var(--radius);
}

html.fate-theme-dci .store-card-fate__cover--empty {
    background: var(--bg2);
    color: var(--muted);
}

html.fate-theme-dci .masseur-tabs__btn {
    border-radius: 3px 3px 0 0;
    border: 1px solid var(--dci-border);
    border-bottom: none;
    background: var(--bg2);
    color: var(--muted);
}

html.fate-theme-dci .masseur-tabs__btn.is-active {
    background: var(--card);
    color: var(--fg);
    font-weight: 600;
    border-bottom: 1px solid var(--card);
    margin-bottom: -1px;
}

html.fate-theme-dci .masseur-card {
    border: 1px solid var(--dci-border-soft);
    border-radius: var(--radius);
    background: var(--card);
}

html.fate-theme-dci .crowd-report-tag {
    border-radius: 3px;
}

/* 會員頁 */
html.fate-theme-dci .member-profile-tabs__btn {
    border: 1px solid var(--dci-border);
    border-radius: 3px;
    background: var(--bg2);
}

html.fate-theme-dci .member-profile-tabs__btn.is-active {
    background: var(--card);
    border-color: var(--accent);
    color: var(--accent);
}

/* 頁腳 */
html.fate-theme-dci .fate-site-brand-footer,
html.fate-theme-dci .fate-counter-footer,
body.fate-theme-dci .fate-site-brand-footer,
body.fate-theme-dci .fate-counter-footer {
    background: var(--bg2);
    border-top: 1px solid var(--dci-border);
    color: var(--muted);
}

html.fate-theme-dci .fate-site-brand-footer a,
html.fate-theme-dci .fate-counter-footer a,
body.fate-theme-dci .fate-site-brand-footer a {
    color: var(--dci-link);
}

/* 廣告位 */
html.fate-theme-dci .fate-ad-slot {
    border: 1px solid var(--dci-border-soft);
    border-radius: var(--radius);
    background: var(--card);
}

html.fate-theme-dci .fate-ad-slot__placeholder {
    background: var(--bg2);
    color: var(--muted);
}

/* 分頁 */
html.fate-theme-dci .pager a,
html.fate-theme-dci .store-pager a {
    border: 1px solid var(--dci-border);
    background: var(--card);
    color: var(--dci-link);
    border-radius: 3px;
}

html.fate-theme-dci .pager a:hover {
    background: var(--bg2);
}

/* ── 手機版 ── */
@media (max-width: 720px) {
    html.fate-theme-dci .topbar-inner,
    body.fate-theme-dci .topbar-inner {
        padding: 0.45rem 0.65rem;
    }

    html.fate-theme-dci .brand,
    body.fate-theme-dci .brand {
        font-size: 0.85rem;
        flex: 1 1 auto;
        min-width: 0;
    }

    html.fate-theme-dci .dci-night-toggle,
    body.fate-theme-dci .dci-night-toggle {
        order: 2;
        margin-left: 0;
    }

    html.fate-theme-dci .topbar nav,
    body.fate-theme-dci .topbar nav {
        order: 3;
        flex: 1 0 100%;
        margin-left: 0;
        padding-top: 0.35rem;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        gap: 0.35rem 0.65rem;
        justify-content: flex-start;
    }

    html.fate-theme-dci .layout-shell,
    body.fate-theme-dci .layout-shell {
        padding: 0 0.55rem;
    }

    html.fate-theme-dci .card-visual {
        min-height: 120px;
    }
}

@media (max-width: 480px) {
    html.fate-theme-dci .topbar nav a,
    body.fate-theme-dci .topbar nav a {
        font-size: 0.8rem;
    }
}
