﻿:root {
    /* 主题色由 lib/_themes.php 注入 --accent 等；此处映射到 bbs 变量名 */
    --brand: var(--accent, #6528f7);
    --brand-deep: var(--accent-deep, #4f46e5);
    --text: #333;
    --text-muted: #666;
    --max-w: 768px;
    --radius: 16px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* support-card 色板 — 与 bbs.php $support_classes 一一对应，不跟随主题 */
.support-card.card-blue { background-color: #2196F3; }
.support-card.card-teal { background-color: #0B6138; }
.support-card.card-purple { background-color: #7E57C2; }
.support-card.card-green { background-color: #31B404; }
.support-card.card-cyan { background-color: #00BCD4; }
.support-card.card-orange { background-color: #FF7043; }
.support-card.card-darkblue { background-color: #1a237e; }
.support-card.card-purple-light { background-color: #7E57C2; }
.support-card.card-teal-dark { background-color: #00695c; }
.support-card.card-blue2 { background-color: #2d6cfc; }
.support-card.card-lightpurple { background-color: #d99dfc; }
.support-card.card-blue3 { background-color: #8080e0; }
.support-card.card-blue4 { background-color: #5353db; }
.support-card.card-darkgold { background-color: #C0A000; }
.support-card.card-amber { background-color: #FFBF00; }
.support-card.card-mustard { background-color: #D4AF37; }
.support-card.card-bronze { background-color: #CD7F32; }
.support-card.card-darkyellow { background-color: #B8860B; }
.support-card.card-forestgreen { background-color: #228B22; }
.support-card.card-seagreen { background-color: #2E8B57; }
.support-card.card-deeppurple { background-color: #6A0DAD; }
.support-card.card-violet { background-color: #8A2BE2; }
.support-card.card-royalblue { background-color: #4169E1; }
.support-card.card-deepskyblue { background-color: #00BFFF; }
.support-card.card-pink { background-color: #F7819F; }
.support-card.card-hotpink { background-color: #FE2E64; }

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a,
a:hover,
a:focus,
a:visited,
a:active {
    text-decoration: none;
}

html {
    height: 100%;
}

html,
body {
    width: 100%;
    overflow-x: hidden;
    font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding-top: 116px;
    background-color: #ffffff;
    color: var(--text);
}

/* Layout */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 10px;
    width: 100%;
}

#main {
    padding: 0 0 15px;
    background: #fff;
}

.post-body {
    padding: 0;
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding-top: 16px;
    background: #fff;
    z-index: 1000;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 42px;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: #000;
    line-height: 24px;
}

/* Tabs */
.tab-wrapper {
    position: fixed;
    top: 58px;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 999;
    padding: 0;
}

.tab-container {
    background: #fff;
    border-radius: 50px;
    padding: 5px;
    margin: 0 auto;
    max-width: var(--max-w);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tabs {
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tab-item {
    flex: 1;
    text-align: center;
    margin: 0;
}

.tab-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 25px;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    min-height: 42px;
}

.tab-link:hover {
    text-decoration: none;
    color: var(--text-muted);
}

.tab-link.active {
    background-color: var(--brand);
    color: #fff;
}

/* Ads */
.ad-container {
    width: 100%;
    max-width: var(--max-w);
    margin: 15px auto;
}

.adsbygoogle {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
}

/* Detail blocks */
.bbs-block {
    width: 100%;
    box-sizing: border-box;
    margin: 16px 0;
    border-radius: 12px;
    padding: 20px;
    line-height: 1.65;
    font-size: 16px;
    color: #222;
}

.bbs-block-title {
    font-weight: 700;
    font-size: 17px;
    margin-bottom: 10px;
}

.bbs-block-text {
    color: #444;
    line-height: 1.7;
}

/* 1) CTA + body */
.bbs-block-cta {
    background: #fff;
    border: 1px solid #e2e2ea;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.bbs-cta-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    border: 2px solid var(--brand);
    border-radius: 12px;
    background: #fff;
    color: var(--brand);
    text-decoration: none;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease;
}

.bbs-cta-link:hover {
    background: var(--brand);
    color: #fff;
    text-decoration: none;
}

.bbs-cta-link .bbs-cta-arrow {
    flex: 0 0 auto;
    font-size: 18px;
}

.bbs-cta-body {
    margin-top: 14px;
    padding: 0;
    background: transparent;
    color: #444;
    line-height: 1.75;
    font-size: 15px;
}

/* 2) Link only */
.bbs-block-link {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

.bbs-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    background: var(--brand);
    color: #fff;
    border-radius: 12px;
    padding: 16px 18px;
    text-decoration: none;
    font-weight: 600;
    font-size: 17px;
}

.bbs-cta-btn:hover {
    box-shadow: 0 4px 14px rgba(var(--shadow-rgb, 101, 40, 247), 0.28);
    text-decoration: none;
    color: #fff;
}

.bbs-cta-btn-solo {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
}

/* 3) Section title + body */
.bbs-block-section {
    background: #fff;
    border: 1px solid var(--line, #d8dee9);
    border-left: 4px solid var(--h3-border, var(--brand));
}

.bbs-block-section .bbs-block-title {
    color: var(--accent-deep, var(--brand));
}

/* 3b) Pipe list — | 分割行（标题/内容/按钮） */
.bbs-pipe-list {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.bbs-pipe-heading {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent-deep, var(--brand));
    line-height: 1.35;
}

.bbs-pipe-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.bbs-pipe-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e8ecf3;
    box-shadow: none;
    transition: border-color 0.15s ease;
}

.bbs-pipe-row:hover {
    border-color: color-mix(in srgb, var(--brand) 35%, #e8ecf3);
}

.bbs-pipe-info {
    flex: 1 1 auto;
    min-width: 0;
}

.bbs-pipe-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--brand);
    line-height: 1.4;
}

.bbs-pipe-desc {
    margin-top: 5px;
    font-size: 13px;
    color: #667085;
    line-height: 1.45;
}

.bbs-pipe-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: none;
    transition: filter 0.15s ease;
}

.bbs-pipe-btn:hover {
    color: #fff;
    text-decoration: none;
    filter: brightness(1.05);
}

.bbs-pipe-btn-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 4) Info */
.bbs-block-info {
    background: var(--accent-soft, #eaf4ff);
    border: 1px solid var(--tag-border, #c5dbf5);
}

.bbs-block-info .bbs-block-title {
    color: var(--tag-color, var(--accent-deep, #0047b3));
}

/* 5) Dash one-line */
.bbs-block-dash {
    background: #fff;
    border: 2px dashed var(--brand);
    text-align: center;
    padding: 16px 20px;
}

.bbs-block-dash .bbs-block-title {
    color: var(--accent-deep, var(--brand));
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bbs-block-dash .bbs-block-title a,
.bbs-block-dash .bbs-block-title a:link,
.bbs-block-dash .bbs-block-title a:visited,
.bbs-block-dash .bbs-block-title a:hover,
.bbs-block-dash .bbs-block-title a:active {
    color: inherit;
    text-decoration: none;
}

/* 6) Alert */
.bbs-block-alert {
    background: #fff;
    border: 1px solid #d44;
    text-align: center;
}

.bbs-block-alert .bbs-block-title {
    color: #d00;
    margin-bottom: 0;
}

/* 7) Tip */
.bbs-block-tip {
    background: rgb(255, 251, 231);
    border: 1px solid #f0e2a8;
}

.bbs-block-tip .bbs-block-title {
    color: #8a6d1d;
}

/* 8) Detail — 标题 + 链接标题居中，正文左对齐 */
.bbs-block-detail {
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--brand) 8%, #fff) 0%,
        #fff 48%
    );
    border: 1px solid color-mix(in srgb, var(--brand) 18%, #e8ecf3);
    border-radius: 14px;
    padding: 20px 18px 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.bbs-block-detail-head {
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--brand) 12%, #eef1f6);
}

.bbs-block-detail .bbs-block-title {
    color: #1f2937;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.bbs-block-detail .bbs-block-label {
    display: inline-block;
    font-weight: 700;
    font-size: 13px;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--brand) 22%, #fff);
    border-radius: 999px;
    padding: 6px 14px;
    margin-bottom: 0;
    line-height: 1.35;
}

.bbs-block-detail .bbs-block-text {
    color: #4b5563;
    font-size: 15px;
    line-height: 1.7;
    text-align: left;
}

/* 9) Extra — X-1 + 正文 */
.bbs-block-extra {
    background: #f5f7fb;
    border: 1px solid #dce3ef;
}

.bbs-block-extra .bbs-block-title {
    color: #3d4a63;
}

/* 10) Note — 免责/注释正文（※） */
.bbs-block-note {
    background: #f7f8fa;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    padding: 16px 18px;
    box-shadow: none;
}

.bbs-block-note .bbs-block-text {
    color: #666;
    font-size: 13px;
    line-height: 1.65;
    margin: 0;
}

/* Home: content card */
.content-card {
    background: #EEF1FF;
    border-radius: var(--radius);
    padding: 25px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.card-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.card-text {
    color: #666;
    line-height: 1.6;
}

.card-icon {
    position: absolute;
    bottom: 16px;
    right: 16px;
    font-size: 2.2rem;
    opacity: 0.8;
    display: block;
    line-height: 1;
}

.section-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 30px 0 15px;
    color: #333;
}

/* Home: support grid */
.support-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.support-card {
    display: block;
    text-decoration: none;
    border-radius: 20px;
    padding: 25px;
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow);
    min-height: 120px;
    border: none;
}

.support-card:hover {
    text-decoration: none;
}

.support-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.support-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.support-icon {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: 2rem;
}

/* Footer — 跟随 lib/_themes.php 主题色 */
.footer {
    flex-shrink: 0;
    background: var(--accent-soft, #E3F2FD);
    color: var(--text);
    padding: 20px 0;
    margin-top: auto;
    width: 100%;
    border-top: 1px solid var(--tag-border, var(--line, transparent));
}

.footer-content {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-left {
    flex: 1;
}

.footer-right {
    text-align: right;
}

.footer-right a {
    color: var(--accent, #1976D2);
    text-decoration: none;
}

.footer-right a:hover {
    color: var(--accent-deep, var(--accent, #1976D2));
    text-decoration: none;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 10px;
}

.footer-brand {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--accent-deep, var(--accent, #1976D2));
}

.footer-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-info li {
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive */
@media screen and (max-width: 768px) {
    body {
        font-size: 18px;
    }

    .container {
        padding: 10px;
    }

    .tab-link {
        padding: 10px 4px;
        font-size: 13px;
    }

    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .footer-left,
    .footer-right {
        text-align: center;
        width: 100%;
    }

    .footer-info li {
        justify-content: center;
        margin-bottom: 8px;
    }
}

@media screen and (max-width: 480px) {
    .tab-container {
        width: 92%;
    }

    .tab-link {
        font-size: 12px;
        padding: 10px 2px;
    }

    .bbs-pipe-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .bbs-pipe-btn {
        width: 100%;
    }

    .support-grid {
        gap: 10px;
    }

    .support-card {
        padding: 15px;
        min-height: 120px;
    }

    .support-title,
    .support-subtitle {
        font-size: 16px;
    }

    .support-icon {
        font-size: 1.5rem;
        bottom: 15px;
        right: 15px;
    }

    .content-card .card-icon {
        display: none;
    }

    .footer {
        padding: 20px 15px;
    }

    .footer-content {
        padding: 0 10px;
    }
}
