/* ============================================================
   Ning's Club · 清新亮色主题（参考 AstroBox 观感 + 苹果圆角）
   作为覆盖层，加载在 style.css 之后
   ============================================================ */
:root {
    --stamp: #4f5bd5;
    --stamp-hover: #3f49b8;
    --brand: #4f5bd5;
    --brand-hover: #3f49b8;
    --brand-soft: rgba(79, 91, 213, 0.10);
    --plate: #1d2233;
    --plate-dark: #12172a;
    --primary: #4f5bd5;
    --primary-dark: #3f49b8;
    --primary-light: #eef0ff;
    --accent: #6c7bff;

    --paper: #f4f5f9;
    --sheet: #ffffff;
    --bg: #f4f5f9;
    --bg-soft: #eef0f6;
    --card: #ffffff;

    --ink: #1a1f2e;
    --text: #1a1f2e;
    --text-secondary: #4c5568;
    --text-muted: #7a8397;
    --rule: #e6e8f0;
    --rule-strong: #d7dbe8;

    --success: #12a150;
    --warning: #e08a00;
    --danger: #e5484d;

    --radius: 18px;
    --radius-sm: 12px;
    --card-pad: 22px;

    --shadow: 0 1px 2px rgba(26, 31, 46, 0.04), 0 6px 18px rgba(26, 31, 46, 0.06);
    --shadow-md: 0 8px 26px rgba(26, 31, 46, 0.10);
    --shadow-lg: 0 20px 50px rgba(26, 31, 46, 0.14);
    --focus-ring: 0 0 0 3px rgba(79, 91, 213, 0.22);
}

body {
    background:
        radial-gradient(1100px 520px at 8% -8%, rgba(108, 123, 255, 0.10), transparent 55%),
        radial-gradient(900px 480px at 100% 0%, rgba(18, 161, 80, 0.06), transparent 50%),
        linear-gradient(180deg, #f6f7fb 0%, var(--paper) 60%, #eef0f6 100%);
    color: var(--text);
}

/* 头部 / 导航 */
.header {
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid var(--rule) !important;
}
.nav a { border-radius: 10px; transition: background .2s var(--ease-out), color .2s var(--ease-out); }
.nav a:hover { background: var(--brand-soft); }
.nav a.active { color: var(--brand); }

/* 通用卡片：大圆角 + 柔和阴影 */
.card,
.resource-card,
.user-search-card,
.stat-card,
.home-ads-slide,
.detail-cover {
    border-radius: var(--radius) !important;
}
.card {
    border: 1px solid var(--rule);
    box-shadow: var(--shadow);
    background: var(--sheet);
}
.card-title { font-weight: 700; letter-spacing: -0.01em; }

/* 按钮：苹果圆角、主色渐变 */
.btn {
    border-radius: 12px !important;
    font-weight: 600;
    transition: transform .12s var(--ease-out), box-shadow .2s var(--ease-out), background .2s var(--ease-out);
}
.btn:active { transform: scale(.975); }
.btn-primary {
    background: linear-gradient(180deg, #5d69e0, #4f5bd5) !important;
    border: none !important;
    box-shadow: 0 6px 16px rgba(79, 91, 213, 0.28);
    color: #fff !important;
}
.btn-primary:hover { background: linear-gradient(180deg, #6c78ff, #4450c8) !important; }
.btn-outline { border-radius: 12px !important; }
.btn-success { background: linear-gradient(180deg, #19b25a, #12a150) !important; border: none !important; }
.btn-danger { background: linear-gradient(180deg, #f0575c, #e5484d) !important; border: none !important; }

/* 输入框 */
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="url"], textarea, select {
    border-radius: 12px !important;
    border: 1px solid var(--rule-strong) !important;
    background: #fbfcff !important;
    transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
input:focus, textarea:focus, select:focus {
    border-color: var(--brand) !important;
    box-shadow: var(--focus-ring) !important;
    outline: none !important;
}

/* 资源卡封面圆角 */
.resource-cover { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.resource-type-badge { border-radius: 999px !important; }

/* 表格 */
table { border-radius: 14px; overflow: hidden; }
.table-wrap { border-radius: 14px; }

/* 提示条 */
.alert { border-radius: 14px !important; }

/* 头像统一圆角 */
.avatar { border-radius: 999px; overflow: hidden; }

/* ---------------- 社区志愿管理者 ---------------- */
.ns-volunteer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 1px 8px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    color: #7d6122;
    background: #fff;
    border: 1px solid rgba(160, 125, 44, .45);
    border-radius: 6px;
    vertical-align: middle;
    white-space: nowrap;
}
.ns-volunteer-badge::before {
    content: "";
    width: 4px; height: 4px;
    border-radius: 1px;
    background: #a07d2c;
}

/* 官方认证凭证（纸面 + 烫金细线 + 印章） */
.ns-volunteer-idcard {
    --vid-ink: #1f1c17;
    --vid-sub: #6b6357;
    --vid-muted: #9a9287;
    --vid-gold: #a07d2c;
    --vid-rule: rgba(31, 28, 23, .10);
    position: relative;
    max-width: 460px;
    margin: 0;
    padding: 16px 18px 18px;
    overflow: hidden;
    color: var(--vid-ink);
    background: #fdfdfb;
    border: 1px solid var(--vid-rule);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(31, 28, 23, .04), 0 10px 28px -20px rgba(31, 28, 23, .45);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}
/* 极轻纸纹，替代整块渐变，避免「AI 渐变卡」观感 */
.ns-volunteer-idcard::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(0deg, rgba(31, 28, 23, .022) 0 1px, transparent 1px 3px);
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 38%);
    mask-image: linear-gradient(180deg, #000, transparent 38%);
}
.ns-volunteer-idcard > * { position: relative; }

.ns-vid-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--vid-rule);
}
.ns-vid-org {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .12em;
    color: var(--vid-sub);
    white-space: nowrap;
}
.ns-vid-org > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ns-vid-org::before {
    content: "宁";
    flex: none;
    width: 16px; height: 16px;
    display: grid;
    place-items: center;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--vid-gold);
    border: 1px solid var(--vid-gold);
    border-radius: 3px;
}
.ns-vid-serial {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10.5px;
    letter-spacing: .06em;
    color: var(--vid-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ns-vid-main { display: flex; align-items: center; gap: 14px; padding: 16px 0 14px; }
.ns-vid-photo {
    width: 60px; height: 60px;
    flex: none;
    overflow: hidden;
    border: 1px solid var(--vid-rule);
    border-radius: 12px;
    background: #f6f4ef;
}
.ns-vid-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.ns-vid-initial {
    width: 100%; height: 100%;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--vid-gold);
    background: linear-gradient(180deg, #fbf8f1, #f3efe5);
}
.ns-vid-kicker {
    margin: 0 0 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--vid-gold);
}
.ns-vid-name {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: var(--vid-ink);
}
.ns-vid-role {
    margin: 5px 0 0;
    font-size: 12.5px;
    color: var(--vid-sub);
}

.ns-vid-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--vid-rule);
}
.ns-vid-meta > div { min-width: 0; padding: 0 12px; border-left: 1px solid var(--vid-rule); }
.ns-vid-meta > div:first-child { padding-left: 0; border-left: 0; }
.ns-vid-meta dt {
    margin-bottom: 3px;
    font-size: 9.5px;
    letter-spacing: .12em;
    color: var(--vid-muted);
}
.ns-vid-meta dd {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--vid-ink);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ns-vid-live {
    display: inline-block;
    width: 5px; height: 5px;
    margin-right: 5px;
    border-radius: 50%;
    background: #2f8f5b;
    box-shadow: 0 0 0 2px rgba(47, 143, 91, .14);
    vertical-align: 1px;
}

.ns-vid-foot {
    margin: 14px 0 0;
    padding-top: 12px;
    padding-right: 64px;
    border-top: 1px solid var(--vid-rule);
    font-size: 10.5px;
    line-height: 1.65;
    color: var(--vid-muted);
}
.ns-vid-seal {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 52px; height: 52px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    color: var(--vid-gold);
    border: 1.5px solid var(--vid-gold);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    transform: rotate(-6deg);
    opacity: .9;
    mix-blend-mode: multiply;
    pointer-events: none;
}
.ns-vid-seal span { display: grid; place-items: center; }

@media (max-width: 480px) {
    .ns-volunteer-idcard { padding: 14px 15px 16px; }
    .ns-vid-name { font-size: 18px; }
    .ns-vid-meta > div { padding: 0 9px; }
    .ns-vid-seal { right: 13px; bottom: 13px; width: 46px; height: 46px; font-size: 9px; }
    .ns-vid-foot { padding-right: 56px; }
}

/* ---------------- 后台外观 ---------------- */
.admin-body { background: var(--bg) !important; }
.admin-sidebar {
    background: linear-gradient(180deg, #1d2233, #12172a) !important;
    border-radius: 0 22px 22px 0;
}
.admin-content { background: var(--bg) !important; }
.admin-topbar {
    background: rgba(255,255,255,.8) !important;
    backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--rule);
}
.admin-nav a { border-radius: 12px; transition: background .18s var(--ease-out); }
.admin-nav a.active, .admin-nav a:hover { background: rgba(108,123,255,.16) !important; }
.admin-body .card { border-radius: 18px !important; }

/* 折叠分组（后台侧栏） */
.ns-navgroup { margin: 4px 0; }
.ns-navgroup > summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; font-size: 12px; font-weight: 700; letter-spacing: .04em;
    color: rgba(255,255,255,.55); text-transform: uppercase; user-select: none;
    border-radius: 10px;
}
.ns-navgroup > summary::-webkit-details-marker { display: none; }
.ns-navgroup > summary::after {
    content: "▾"; margin-left: auto; transition: transform .2s var(--ease-out); opacity: .7;
}
.ns-navgroup[open] > summary::after { transform: rotate(180deg); }
.ns-navgroup > summary:hover { color: #fff; }

/* 通用可折叠卡片 */
.ns-fold > .ns-fold-head {
    cursor: pointer; display: flex; align-items: center; gap: 8px; user-select: none;
}
.ns-fold > .ns-fold-head .ns-fold-arrow {
    margin-left: auto; transition: transform .22s var(--ease-out); opacity: .6;
}
.ns-fold[data-open="1"] > .ns-fold-head .ns-fold-arrow { transform: rotate(180deg); }
.ns-fold[data-open="0"] > .ns-fold-body { display: none; }

/* ---------------- 团队/商户认证头衔 ---------------- */
.author-team-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    /* 未认证：灰色 */
    color: #5b6b6f;
    background: #e3eaea;
    border: 1px solid #d3dddd;
}
.author-team-tag.is-verified {
    color: #123a52;
    background: linear-gradient(135deg, #dbeaf3, #c3dcec);
    border: 1px solid #a9cbe0;
}
.author-team-tag .author-team-name.is-unverified { color: #7a8a8e; }

/* 团队蓝 V 认证徽标 */
.team-verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #2a9df4, #1b7fb8);
    border-radius: 50%;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(27, 127, 184, 0.4);
}

/* 签名旁小问号（可点开提示） */
.ns-sign-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px; height: 18px;
    margin-left: 6px;
    font-size: 12px; font-weight: 800; line-height: 1;
    color: #fff;
    background: #6c7f82;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    vertical-align: middle;
    transition: transform .15s var(--ease-out), background .2s var(--ease-out);
}
.ns-sign-help:hover { background: #253745; transform: scale(1.08); }
.ns-sign-help.is-verified { background: #1b7fb8; }
.ns-sign-help.is-verified:hover { background: #11212d; }

/* 签名提示浮层 */
.ns-sign-tip {
    position: fixed;
    z-index: 300;
    max-width: 280px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: #fff;
    background: rgba(6, 20, 27, 0.96);
    box-shadow: 0 16px 40px rgba(6, 20, 27, 0.35);
    backdrop-filter: blur(8px);
}
.ns-sign-tip::after {
    content: "";
    position: absolute;
    top: -6px;
    left: 14px;
    border: 6px solid transparent;
    border-top: 0;
    border-bottom-color: rgba(6, 20, 27, 0.96);
}
.ns-sign-tip.is-verified { background: rgba(15, 59, 86, 0.97); }
.ns-sign-tip.is-verified::after { border-bottom-color: rgba(15, 59, 86, 0.97); }

/* 移动端适配 */
@media (max-width: 768px) {
    :root { --radius: 16px; }
    .ns-volunteer-idcard { max-width: 100%; }
    .ns-sign-tip { max-width: 72vw; }
}
