/* 小程序发布平台 — 深度 Apple 风格主题 */
:root {
    --bg: #f2f2f7;
    --surface: #ffffff;
    --surface-hover: #f5f5f7;
    --border: #c6c6c8;
    --border-light: #e5e5ea;
    --text: #1c1c1e;
    --text-secondary: #8e8e93;
    --text-tertiary: #aeaeb2;
    --accent: #007aff;
    --accent-hover: #0062cc;
    --link: #007aff;
    --link-hover: #0062cc;
    --success: #34c759;
    --success-bg: #e4f8eb;
    --danger: #ff3b30;
    --danger-bg: #ffeceb;
    --warning: #ff9500;
    --warning-bg: #fff4e5;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --mono: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

/* ── 按钮 ── */
.btn-app {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 980px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-app-primary {
    background: var(--accent);
    color: #fff;
}
.btn-app-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-app-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-app-outline:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.btn-app-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-app-ghost:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.btn-app-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: transparent;
}
.btn-app-danger:hover {
    background: #ffcdd2;
    color: var(--danger);
}

.btn-app-lg {
    padding: 14px 28px;
    font-size: 17px;
    width: 100%;
}

.btn-app-sm {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
}

.btn-app:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── 表单 ── */
.form-group { margin-bottom: 24px; }

.form-label {
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 10px;
}

.form-label .step-num {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    flex: 0 0 20px;
    width: 20px;
    height: auto;
    background: none;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    border-radius: 0;
    margin-right: 0;
    font-family: inherit;
}
.form-label .step-num::after { content: "."; }
.required-star { margin-left:4px; color:#ff3b30; font-size:18px; font-weight:800; line-height:1; position:relative; top:-1px; }

.form-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.form-control-app {
    display: block;
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface-hover);
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-family: var(--font);
}

.form-control-app:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

.form-control-app::placeholder { color: var(--text-tertiary); }

select.form-control-app {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386868b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-control-app.mono { font-family: var(--mono); font-size: 14px; }

.input-addon {
    display: flex;
    align-items: stretch;
}
.input-addon .addon {
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: var(--surface-hover);
    border: 1px solid transparent;
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--text-secondary);
    font-size: 16px;
}
.input-addon .form-control-app {
    border-radius: 0 var(--radius) var(--radius) 0;
    flex: 1;
}

.form-section {
    padding: 16px 20px;
    background: var(--surface-hover);
    border: 1px solid transparent;
    border-radius: var(--radius);
}

/* ── 卡片 ── */
.card-app {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-app-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-app-body { padding: 24px; }

/* ── 导航栏 ── */
.navbar-app {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    height: 60px;
}

.navbar-app .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    gap: 16px;
}

.app-logo {
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}
.app-logo-sm { width: 32px; height: 32px; }
.app-logo-md { width: 48px; height: 48px; }
.app-logo-lg { width: 64px; height: 64px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: max-content;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1;
}

.brand-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: block;
}

.brand-logo-auth {
    width: 48px;
    height: 48px;
}

.brand-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 1;
    min-width: 0;
}

.nav-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: 980px;
    background: var(--surface);
}

.nav-meta strong { color: var(--text); font-weight: 500; }

.nav-meta.credit-ok {
    border-color: #c8e6c9;
    background: var(--success-bg);
    color: var(--success);
}
.nav-meta.credit-ok strong { color: var(--success); }

.nav-meta.credit-low {
    border-color: #ffcdd2;
    background: var(--danger-bg);
    color: var(--danger);
}
.nav-meta.credit-low strong { color: var(--danger); }

/* ── 移动端信息条 ── */
.mobile-bar {
    display: none;
    background: var(--surface);
    border: none;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.mobile-bar .credit-badge {
    font-size: 14px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 980px;
}
.mobile-bar .credit-badge.ok { background: var(--success-bg); color: var(--success); }
.mobile-bar .credit-badge.low { background: var(--danger-bg); color: var(--danger); }

/* ── 页面布局 ── */
.page-body {
    padding-top: 88px;
    padding-bottom: 64px;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.layout-grid {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 24px;
    align-items: start;
}

/* ── 公告区 ── */
.info-content {
    padding: 24px;
    line-height: 1.6;
    font-size: 15px;
    color: var(--text-secondary);
}
.info-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin: 12px 0;
    cursor: zoom-in;
}
.info-content h1, .info-content h2, .info-content h3 {
    color: var(--text);
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 12px;
}
.info-content ul { padding-left: 24px; }
.announcement-loading { min-height: 330px; }
.announcement-skeleton { padding: 4px 0; }
.announcement-skeleton span { display:block; height:16px; margin-bottom:16px; border-radius:8px; background:linear-gradient(90deg,#f1f2f5 25%,#fafafa 50%,#f1f2f5 75%); background-size:200% 100%; animation:announcementShimmer 1.3s infinite; }
.announcement-skeleton span:nth-child(2) { width:86%; }
.announcement-skeleton span:nth-child(3) { width:72%; }
.announcement-skeleton span:nth-child(4) { width:91%; height:120px; margin-top:24px; }
@keyframes announcementShimmer { to { background-position:-200% 0; } }

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: var(--text-tertiary);
    font-size: 15px;
}

/* ── 终端日志 ── */
.terminal-box {
    background: #1d1d1f;
    color: #f5f5f7;
    padding: 16px 20px;
    border-radius: var(--radius);
    white-space: pre-wrap;
    word-break: break-all;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.6;
    margin-top: 16px;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 隐藏滚动条但保留滚动功能 (Webkit) */
.terminal-box::-webkit-scrollbar {
    display: none;
}
.terminal-box {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* ── 提示框 ── */
.alert-app {
    padding: 16px 20px;
    border-radius: var(--radius);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 24px;
    border: none;
}
.alert-app h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.alert-app-success { background: var(--success-bg); color: var(--success); }
.alert-app-danger { background: var(--danger-bg); color: var(--danger); }
.alert-app-warning { background: var(--warning-bg); color: var(--warning); }

/* ── 弹窗 ── */
.modal-app .modal-content {
    border: none;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}
.modal-app .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}
.modal-app .modal-title {
    font-size: 17px;
    font-weight: 600;
}
.modal-app .modal-body { padding: 24px; }
.modal-app .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}
.user-name-button { cursor:default; }
.user-name-button:hover { background:var(--surface); color:var(--text); }

/* 商品购买与扫码支付 */
.purchase-body { text-align: center; padding: 28px !important; }
.pay-product-card { text-align:center; margin-bottom:22px; }
.pay-product-cover { width:150px; height:150px; overflow:hidden; border-radius:18px; margin:0 auto 18px; background:#f2f5f9; border:1px solid #edf0f4; }
.pay-product-cover img { width:100%; height:100%; object-fit:cover; display:block; }
.pay-product-placeholder { display:flex; align-items:center; justify-content:center; color:#9aa3af; font-size:18px; background:#f5f6f8; }
.pay-product-card h3 { margin:0 0 8px; font-size:19px; line-height:1.4; }
.purchase-price { color:#1677ff; font-size:27px; font-weight:700; }
.purchase-price small { font-size:15px; margin-right:2px; }
.pay-button { background:#1677ff; border:none; box-shadow:none; }
.pay-button:hover { background:#0867d8; }
.pay-button::before, .pay-button .alipay-mark { display:none !important; content:none !important; }
.pay-error { margin-bottom:14px; padding:11px 14px; color:#c62828; background:#fff1f0; border-radius:10px; font-size:13px; text-align:left; word-break:break-word; }
#qrArea { text-align: center; }
.qr-shell { position:relative; display:inline-block; padding:14px; margin:0 auto 14px; background:#fff; border:1px solid #e5eaf1; border-radius:20px; box-shadow:0 12px 35px rgba(34,74,130,.12); }
#payQrCode { display: block; }
#payQrCode img, #payQrCode canvas { display: block; }
#qrArea p { margin: 0 0 8px; font-weight: 600; }
.pay-order-hint { color: var(--text-tertiary); font-size: 13px; }
.qr-order-name { margin-bottom:8px; color:var(--text); font-size:18px; font-weight:650; }
.qr-order-amount { display:flex; align-items:baseline; justify-content:center; gap:10px; margin-bottom:18px; color:var(--text-tertiary); font-size:13px; }
.qr-order-amount strong { color:#1677ff; font-size:20px; }
.qr-order-amount b { font-size:28px; }
.qr-countdown { color:var(--text-tertiary); font-size:13px; }
.qr-countdown strong { margin-left:5px; color:#ef6c00; font-family:var(--mono); font-size:15px; }
.pay-pulse { display:inline-block; width:7px; height:7px; margin-right:7px; border-radius:50%; background:#16a36a; box-shadow:0 0 0 5px rgba(22,163,106,.11); animation:payPulse 1.5s infinite; }
@keyframes payPulse { 50% { opacity:.35; } }
.admin-product-image { width:96px; height:96px; display:block; object-fit:cover; border-radius:14px; margin-bottom:12px; border:1px solid var(--border-light); }
.store-product-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; text-align:center; }
.store-product-card { display:flex; flex-direction:column; align-items:center; padding:20px; border:1px solid var(--border-light); border-radius:18px; background:#fff; }
.store-product-image { width:120px; height:120px; display:flex; align-items:center; justify-content:center; overflow:hidden; border-radius:16px; background:#f5f6f8; color:#9aa3af; }
.store-product-image img { width:100%; height:100%; object-fit:cover; }
.store-product-card h3 { margin:14px 0 6px; font-size:17px; line-height:1.4; }
.store-product-price { margin-bottom:15px; color:#1677ff; font-size:25px; font-weight:700; }
.store-product-price small { font-size:14px; }
.store-recharge-note { margin:-1px 0 12px; color:var(--text-tertiary); font-size:12px; }
.quantity-purchase { width:100%; margin:-2px 0 15px; padding:12px; border-radius:12px; background:var(--surface-hover); color:var(--text-secondary); font-size:12px; }
.quantity-stepper { display:flex; align-items:center; justify-content:center; margin:9px 0; }
.quantity-stepper button { width:34px; height:34px; padding:0; border:1px solid var(--border); background:#fff; color:var(--text); font-size:20px; cursor:pointer; }
.quantity-stepper button:first-child { border-radius:9px 0 0 9px; }
.quantity-stepper button:last-child { border-radius:0 9px 9px 0; }
.quantity-input { width:52px; height:34px; padding:0 4px; border:1px solid var(--border); border-left:0; border-right:0; background:#fff; color:var(--text); text-align:center; font-weight:600; appearance:textfield; }
.quantity-input::-webkit-inner-spin-button { appearance:none; }
.quantity-total strong { color:#1677ff; font-size:14px; }
.store-card-button { width:100%; margin-top:auto; justify-content:center; }
.store-paid-name { margin-bottom:9px; color:var(--success); font-size:13px; font-weight:600; }
.store-delivery { width:100%; padding:10px; margin-bottom:12px; border-radius:10px; background:var(--surface-hover); color:var(--text-secondary); font-size:12px; text-align:left; word-break:break-word; }
.admin-product-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.admin-product-card { padding:20px; border:1px solid var(--border-light); border-radius:18px; background:var(--surface); }
.admin-product-card-image { width:110px; height:110px; display:flex; align-items:center; justify-content:center; object-fit:cover; margin:0 auto 18px; border-radius:16px; background:var(--surface-hover); color:var(--text-tertiary); }
.admin-product-actions { display:flex; justify-content:space-between; gap:10px; }
.purchase-success h3 { margin: 12px 0 18px; }
.success-check { width: 58px; height: 58px; line-height: 58px; margin: 0 auto; border-radius: 50%; background: var(--success-bg); color: var(--success); font-size: 30px; font-weight: 700; }
.delivery-box { text-align: left; padding: 16px; margin-bottom: 20px; border-radius: var(--radius); background: var(--surface-hover); color: var(--text-secondary); line-height: 1.7; word-break: break-word; }

/* ── 表格 ── */
.table-app {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table-app th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    background: var(--surface-hover);
}
.table-app td {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}
.table-app tbody tr:last-child td { border-bottom: none; }
.table-app tbody tr:hover td { background: var(--surface-hover); }

.tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
}
.tag-system { background: #e8f0fe; border-color: transparent; color: #1a73e8; }
.tag-version { font-family: var(--mono); font-size: 12px; }
.text-deduct { color: var(--danger); font-weight: 500; }
.text-add { color: var(--success); font-weight: 500; }

/* ── 预览图 ── */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}
.preview-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    transition: all 0.2s ease;
}
.preview-card:hover { 
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}
.preview-thumb {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover);
    cursor: pointer;
    overflow: hidden;
}
.preview-thumb img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}
.preview-name {
    padding: 12px;
    font-size: 13px;
    color: var(--text);
    text-align: center;
    border-top: 1px solid var(--border-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Loading ── */
#loading {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
    padding-top: 35vh;
}
.loading-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading h3 { font-size: 18px; font-weight: 600; margin-top: 24px; color: var(--text); }
#loading p { font-size: 15px; color: var(--text-secondary); margin-top: 8px; }

/* ── 登录页 ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: none;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.auth-header {
    padding: 48px 40px 0;
    text-align: center;
}

.auth-logo-wrap {
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
}

.auth-header h1.brand-title {
    font-size: 24px;
    margin: 0 0 8px;
}

.auth-header p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

.auth-body { padding: 32px 40px 40px; }

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 32px;
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-tertiary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    margin-bottom: -1px;
}
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.auth-footer {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-light);
    background: var(--surface-hover);
    border-radius: 0 0 24px 24px;
}

/* ── 管理后台 ── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.admin-sidebar-head {
    padding: 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.admin-sidebar-head .brand-title {
    font-size: 16px;
    white-space: nowrap;
}

.admin-nav { padding: 12px; flex: 1; }

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 15px;
    color: var(--text-secondary);
    border-radius: var(--radius);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease;
}
.admin-nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}
.admin-nav-item.active {
    background: var(--surface-hover);
    color: var(--accent);
    font-weight: 500;
}
.admin-nav-item.danger { color: var(--danger); }
.admin-nav-item.danger:hover { background: var(--danger-bg); }

.admin-nav-divider {
    height: 1px;
    background: var(--border-light);
    margin: 12px 16px;
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 32px 40px;
}

.admin-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.admin-page-head h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

.admin-badge {
    font-size: 13px;
    padding: 6px 12px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 980px;
    color: var(--text-secondary);
}

.admin-table-wrap { overflow-x: auto; }
.project-config-table td:first-child { width: 38%; }
.project-config-table .form-control-app { padding: 10px 14px; }
.admin-group-select { min-width: 130px; padding: 8px 34px 8px 12px; font-size: 14px; }
.group-create-form { display: flex; gap: 12px; max-width: 560px; }
.group-create-form .form-control-app { flex: 1; }

.admin-recharge-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.admin-recharge-form input {
    width: 80px;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.2s ease;
}
.admin-recharge-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.credit-pill {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 980px;
}
.credit-pill.ok { background: var(--success-bg); color: var(--success); }
.credit-pill.zero { background: var(--surface-hover); color: var(--text-tertiary); }

.row-admin { background: #fbfbfd !important; }

.card-app-footer {
    padding: 16px 24px;
    font-size: 13px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-light);
    background: var(--surface-hover);
}

.tip-bar {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--surface-hover);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 575px) {
    .form-row-2 { grid-template-columns: 1fr; }
    .pay-product-cover { width:128px; height:128px; }
    .purchase-body { padding:20px !important; }
    .store-product-grid, .admin-product-grid { grid-template-columns:1fr; }
}
.admin-recharge-form input[name="secondary_password"] { width: 112px; }
.announcement-security-row { display:flex; justify-content:flex-end; align-items:center; gap:12px; margin-top:16px; }
.announcement-security-row .form-control-app { max-width:280px; padding:10px 14px; }

/* ── Bootstrap 兼容（弹窗 / 响应式） ── */
.d-none { display: none !important; }
@media (min-width: 768px) {
    .d-md-flex { display: flex !important; }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    inset: 0;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}
.modal.show { display: block; }
.modal.fade .modal-dialog {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
}
.modal.show .modal-dialog { 
    transform: none; 
    opacity: 1;
}
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal-backdrop.fade { opacity: 0; transition: opacity 0.3s ease; }
.modal-backdrop.show { opacity: 1; }
.modal-dialog {
    position: relative;
    width: auto;
    margin: 2rem auto;
    max-width: 500px;
    pointer-events: none;
}
.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 4rem);
}
.modal-dialog-centered::before {
    display: block;
    height: calc(100vh - 4rem);
    content: "";
}
.modal-xl { max-width: 1140px; }
.modal-lg { max-width: 800px; }
.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background: var(--surface);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.btn-close {
    box-sizing: content-box;
    width: 14px;
    height: 14px;
    padding: 10px;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%231d1d1f'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/14px auto no-repeat;
    border: 0;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.btn-close:hover { opacity: 1; }

/* Bootstrap tab 兼容 */
.tab-content > .tab-pane { display: none; }
.tab-content > .active { display: block; }
.fade { transition: opacity 0.2s ease; }
.fade:not(.show) { opacity: 0; }

/* ── 响应式 ── */
@media (max-width: 991px) {
    .layout-grid { grid-template-columns: 1fr; }
    .nav-meta { display: none !important; }
    .mobile-bar { display: flex; }
}

@media (max-width: 767px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    .admin-nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
    .admin-nav-item { width: auto; flex: 1; justify-content: center; font-size: 14px; padding: 10px; }
    .admin-main { padding: 24px 20px; }
    .auth-body { padding: 24px 24px 32px; }
    .auth-header { padding: 32px 24px 0; }
}
