/* ==========================================================================
   IDC 云产品商城 —— 全局样式
   设计风格：蓝色商务 · 大气扁平化
   零外部依赖（不引用任何 CDN 字体/样式），国内访问稳定
   ========================================================================== */

:root {
    --c-primary: #1d4ed8;
    --c-primary-dark: #1e40af;
    --c-primary-light: #3b82f6;
    --c-primary-bg: #eff6ff;
    --c-accent: #f59e0b;
    --c-success: #10b981;
    --c-danger: #ef4444;
    --c-warning: #f59e0b;
    --c-info: #0ea5e9;

    --c-text: #1f2937;
    --c-text-secondary: #6b7280;
    --c-text-muted: #9ca3af;
    --c-border: #e5e7eb;
    --c-border-light: #f3f4f6;
    --c-bg: #ffffff;
    --c-bg-gray: #f8fafc;
    --c-bg-dark: #0f172a;

    --radius: 8px;
    --radius-lg: 12px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 4px 12px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);

    --header-height: 68px;
    --container: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: var(--c-text);
    background: var(--c-bg-gray);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--c-primary); }
img { max-width: 100%; vertical-align: middle; border: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; outline: none; }
table { border-collapse: collapse; width: 100%; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }

/* ===================== 通用组件 ===================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer; transition: all .2s;
    background: var(--c-border-light); color: var(--c-text); white-space: nowrap;
}
.btn:hover { opacity: .9; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-outline { background: #fff; border-color: var(--c-border); color: var(--c-text); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-success { background: var(--c-success); color: #fff; }
.btn-warning { background: var(--c-warning); color: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--c-border-light); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 20px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; line-height: 18px; }
.badge-primary { background: var(--c-primary-bg); color: var(--c-primary); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-info { background: #e0f2fe; color: #075985; }
.badge-secondary { background: #ede9fe; color: #5b21b6; }
.badge-soft { background: #f1f5f9; color: #475569; }

.text-primary { color: var(--c-primary); }
.text-danger { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.text-warning { color: var(--c-warning); }
.text-muted { color: var(--c-text-muted); }
.text-secondary { color: var(--c-text-secondary); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-bold { font-weight: 600; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.price { color: var(--c-danger); font-weight: 600; font-size: 22px; }
.price-sm { color: var(--c-danger); font-weight: 600; font-size: 16px; }
.price-symbol { font-size: .75em; margin-right: 1px; }
.cycle-mini { display: flex; flex-wrap: wrap; gap: 4px; max-width: 220px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--c-text); }
.form-label .required { color: var(--c-danger); margin-right: 2px; }
.form-control {
    width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--c-border);
    border-radius: var(--radius); background: #fff; color: var(--c-text); transition: border-color .2s;
}
.form-control:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, .1); }
textarea.form-control { height: auto; padding: 8px 12px; min-height: 90px; resize: vertical; line-height: 1.6; }
select.form-control { cursor: pointer; }
.form-hint { margin-top: 4px; font-size: 12px; color: var(--c-text-muted); }
.form-error { margin-top: 4px; font-size: 12px; color: var(--c-danger); }
.form-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.form-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--c-primary); }

/* 表格 */
.table { background: #fff; border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--c-border-light); vertical-align: middle; }
.table th { background: var(--c-bg-gray); font-weight: 600; font-size: 13px; color: var(--c-text-secondary); white-space: nowrap; }
.table tbody tr:hover { background: #fafcff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-responsive { overflow-x: auto; }
/* 实例清单：列较多，窄屏横向滚动而不是挤压换行 */
.table--wide { min-width: 1340px; }
.table--wide th, .table--wide td { white-space: nowrap; }
.table--wide td.mono { font-size: 12.5px; letter-spacing: .2px; }
.table__acts { display: flex; gap: 6px; flex-wrap: nowrap; }
.js-copy-row { cursor: pointer; }

/* ===== 上级资源列表：商品列对齐 ===== */
/* 该列原本要走多行（badge + 实例对照 + 警示），table--wide 的 nowrap 会让两个 div 挤到一行；
   这里把这个单元格放宽，让对照行换行展示但保持紧凑 */
.table .res-product-cell { white-space: normal; min-width: 160px; }
.res-product-cell .res-product-snapshot { display: inline-block; }
.res-product-cell .res-product-instance {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--c-text-secondary, #6b7280);
}
.res-product-cell .res-product-instance.is-missing { color: var(--c-danger, #dc2626); }
.res-product-cell .res-product-warn {
    display: inline-block;
    margin-top: 4px;
    padding: 1px 6px;
    border-radius: 4px;
    background: #fef2f2;
    color: var(--c-danger, #dc2626);
    font-size: 11px;
    line-height: 16px;
}
.res-product-cell .res-product-warn a { color: inherit; text-decoration: underline; }

/* 提示消息 */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* 分页 */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--c-border);
    border-radius: var(--radius-sm); background: #fff; font-size: 13px;
}
.pagination .active span { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.pagination .disabled span { color: var(--c-text-muted); background: var(--c-bg-gray); }

/* ===================== 前台布局 ===================== */
.site-header { background: #fff; border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 100; }
.site-header .container { height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--c-primary); }
.logo-mark { width: 34px; height: 34px; background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light)); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 17px; font-weight: 700; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: var(--radius); font-size: 14px; color: var(--c-text); }
.nav a:hover, .nav a.active { background: var(--c-primary-bg); color: var(--c-primary); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.site-footer { background: var(--c-bg-dark); color: #cbd5e1; margin-top: 60px; padding: 48px 0 24px; }
.site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 14px; font-weight: 600; }
.site-footer a { color: #94a3b8; font-size: 13px; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid #1e293b; font-size: 12px; color: #64748b; text-align: center; }

.breadcrumb { padding: 14px 0; font-size: 13px; color: var(--c-text-muted); }
.breadcrumb a { color: var(--c-text-secondary); }
.breadcrumb a:hover { color: var(--c-primary); }

/* 首页 Hero */
.hero { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #3b82f6 100%); color: #fff; padding: 72px 0 96px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -80px; width: 460px; height: 460px; background: rgba(255,255,255,.06); border-radius: 50%; }
.hero-inner { position: relative; z-index: 1; max-width: 680px; }
.hero h1 { font-size: 40px; line-height: 1.3; font-weight: 700; margin-bottom: 16px; }
.hero p { font-size: 17px; opacity: .92; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-outline { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,.2); }

.hero-stats { position: relative; z-index: 1; display: flex; gap: 40px; margin-top: 48px; flex-wrap: wrap; }
.hero-stats .stat-value { font-size: 28px; font-weight: 700; }
.hero-stats .stat-label { font-size: 13px; opacity: .85; }

.section { padding: 48px 0; }
.section-title { text-align: center; margin-bottom: 32px; }
.section-title h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.section-title p { color: var(--c-text-secondary); font-size: 14px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.product-card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 22px; transition: all .25s; position: relative; display: flex; flex-direction: column; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--c-primary-light); }
.product-card .tag { position: absolute; top: 12px; right: 12px; }
.product-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.product-card .summary { color: var(--c-text-secondary); font-size: 13px; min-height: 42px; margin-bottom: 14px; }
.spec-list { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; padding: 14px 0; border-top: 1px dashed var(--c-border); border-bottom: 1px dashed var(--c-border); }
.spec-list li { display: flex; justify-content: space-between; font-size: 13px; }
.spec-list .label { color: var(--c-text-muted); }
.spec-list .value { font-weight: 500; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }

/* 新版产品卡片（截图模板：标题+国旗 / 地区 / 图标规格 / 周期价格 / 立即购买） */
.product-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.product-card-header h3 { font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--c-text); margin: 0; }
.product-card-header .flag { font-size: 22px; line-height: 1; flex-shrink: 0; }
.product-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; font-size: 13px; }
.product-card-meta .location { display: inline-flex; align-items: center; gap: 5px; color: var(--c-text-secondary); }
.product-card-meta .location i { color: var(--c-primary-light); }
.product-card-meta .type-tag { display: inline-block; padding: 3px 10px; border-radius: var(--radius-sm); background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; font-size: 12px; white-space: nowrap; }
.spec-list-v2 { margin: 0 0 16px; padding: 0; list-style: none; }
.spec-list-v2 li { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--c-border-light); font-size: 13px; }
.spec-list-v2 li:last-child { border-bottom: none; }
.spec-list-v2 .spec-label { display: inline-flex; align-items: center; gap: 8px; color: var(--c-text-muted); }
.spec-list-v2 .spec-label i { color: var(--c-primary-light); font-size: 14px; width: 16px; text-align: center; }
.spec-list-v2 .spec-value { color: var(--c-text); font-weight: 500; }
.cycle-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.cycle-card { text-align: center; padding: 10px 6px; border-radius: var(--radius); border: 1px solid var(--c-border); background: #fff; }
.cycle-card .cycle-label { font-size: 12px; color: var(--c-text-muted); margin-bottom: 4px; }
.cycle-card .cycle-price { font-size: 18px; font-weight: 700; color: var(--c-text); }
.cycle-card.active { border-color: var(--c-primary); background: #eff6ff; }
.cycle-card.active .cycle-label { color: var(--c-primary); }
.cycle-card.active .cycle-price { color: var(--c-primary); }

.category-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.category-card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 24px; text-align: center; transition: all .25s; }
.category-card:hover { border-color: var(--c-primary); box-shadow: var(--shadow); transform: translateY(-3px); }
.category-card .icon { width: 52px; height: 52px; margin: 0 auto 14px; background: var(--c-primary-bg); border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: var(--c-primary); }
.category-card h3 { font-size: 16px; margin-bottom: 6px; }
.category-card p { font-size: 13px; color: var(--c-text-muted); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feature-item { text-align: center; padding: 24px; }
.feature-item .icon { width: 56px; height: 56px; margin: 0 auto 14px; background: var(--c-primary-bg); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--c-primary); }
.feature-item h4 { font-size: 16px; margin-bottom: 6px; }
.feature-item p { font-size: 13px; color: var(--c-text-secondary); }

/* 商品详情 */
.product-detail { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; }
.detail-body { background: #fff; border-radius: var(--radius-lg); padding: 28px; border: 1px solid var(--c-border); }
.detail-side { position: sticky; top: 88px; }
.detail-content { line-height: 1.9; }
.detail-content h2, .detail-content h3 { margin: 22px 0 12px; font-size: 18px; }
.detail-content p { margin-bottom: 12px; }
.detail-content ul { padding-left: 20px; list-style: disc; margin-bottom: 12px; }
.detail-content img { max-width: 100%; border-radius: var(--radius); margin: 8px 0; }

.cycle-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 20px; }
.cycle-option { border: 1px solid var(--c-border); border-radius: var(--radius); padding: 10px 6px; text-align: center; cursor: pointer; transition: all .2s; background: #fff; }
.cycle-option:hover { border-color: var(--c-primary-light); }
.cycle-option.active { border-color: var(--c-primary); background: var(--c-primary-bg); }
.cycle-option .months { font-size: 13px; font-weight: 600; }
.cycle-option .amount { font-size: 12px; color: var(--c-danger); margin-top: 2px; }

/* 订单与结算 */
.checkout-grid { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.order-item-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--c-border-light); font-size: 13px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.summary-total { border-top: 1px solid var(--c-border); margin-top: 8px; padding-top: 12px; font-size: 15px; font-weight: 600; }

.pay-methods { display: flex; flex-direction: column; gap: 10px; }
.pay-method { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--c-border); border-radius: var(--radius); cursor: pointer; transition: all .2s; background: #fff; }
.pay-method:hover { border-color: var(--c-primary-light); }
.pay-method.active { border-color: var(--c-primary); background: var(--c-primary-bg); }
.pay-method .pay-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff; font-weight: 600; }
.pay-icon.alipay { background: #1677ff; }
.pay-icon.wechat { background: #07c160; }
.pay-icon.balance { background: #f59e0b; }

.qr-box { text-align: center; padding: 28px; }
.qr-box #qrcode { display: inline-block; padding: 14px; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); }

/* 用户中心 */
.user-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.user-sidebar { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg); overflow: hidden; }
.user-sidebar .user-info { padding: 20px; text-align: center; border-bottom: 1px solid var(--c-border-light); background: linear-gradient(135deg, var(--c-primary-bg), #fff); }
.user-sidebar .avatar { width: 56px; height: 56px; margin: 0 auto 10px; background: var(--c-primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; }
.user-nav a { display: block; padding: 11px 20px; font-size: 14px; color: var(--c-text); border-left: 3px solid transparent; }
.user-nav a:hover { background: var(--c-bg-gray); color: var(--c-primary); }
.user-nav a.active { background: var(--c-primary-bg); color: var(--c-primary); border-left-color: var(--c-primary); font-weight: 500; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 20px; }
.stat-card .label { font-size: 13px; color: var(--c-text-muted); margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 700; }

/* ===================== 后台布局 ===================== */
.admin-layout { display: flex; min-height: 100vh; background: var(--c-bg-gray); }
.admin-sidebar { width: 220px; background: var(--c-bg-dark); color: #cbd5e1; flex-shrink: 0; position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; }
.admin-sidebar .brand { height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 20px; font-size: 17px; font-weight: 700; color: #fff; border-bottom: 1px solid #1e293b; }
.admin-sidebar .brand .logo-mark { width: 30px; height: 30px; font-size: 15px; }
.admin-menu { padding: 12px 0; }
.admin-menu .menu-group-title { padding: 14px 20px 6px; font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .5px; }
.admin-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 14px; color: #cbd5e1; border-left: 3px solid transparent; }
.admin-menu a:hover { background: #1e293b; color: #fff; }
.admin-menu a.active { background: #1e293b; color: #fff; border-left-color: var(--c-primary-light); }
.admin-menu .icon { width: 18px; text-align: center; opacity: .85; }

.admin-main { flex: 1; margin-left: 220px; min-width: 0; }
.admin-topbar { height: 60px; background: #fff; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.admin-topbar .title { font-size: 16px; font-weight: 600; }
.admin-content { padding: 24px; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.admin-stat { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 20px; display: flex; align-items: center; gap: 16px; }
.admin-stat .icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.icon-blue { background: var(--c-primary-bg); color: var(--c-primary); }
.icon-green { background: #d1fae5; color: var(--c-success); }
.icon-orange { background: #fef3c7; color: var(--c-warning); }
.icon-red { background: #fee2e2; color: var(--c-danger); }
.admin-stat .value { font-size: 22px; font-weight: 700; line-height: 1.2; }
.admin-stat .label { font-size: 12px; color: var(--c-text-muted); }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-control { height: 34px; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3a8a, #2563eb 55%, #3b82f6); padding: 20px; }
.login-box { width: 100%; max-width: 400px; background: #fff; border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-lg); }
.login-box h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
.login-box .subtitle { text-align: center; color: var(--c-text-muted); font-size: 13px; margin-bottom: 26px; }
.captcha-row { display: flex; gap: 10px; }
.captcha-row .form-control { flex: 1; }
.captcha-row img { height: 38px; border-radius: var(--radius); border: 1px solid var(--c-border); cursor: pointer; }

/* ===================== 响应式 ===================== */
@media (max-width: 992px) {
    .product-detail, .checkout-grid, .user-layout { grid-template-columns: 1fr; }
    .detail-side { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .hero { padding: 48px 0 64px; }
    .hero h1 { font-size: 28px; }
    .admin-sidebar { width: 0; overflow: hidden; }
    .admin-main { margin-left: 0; }
    .site-header .container { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 10px; }
    .nav { order: 3; width: 100%; overflow-x: auto; }
    .product-grid { grid-template-columns: 1fr; }
    .container { padding: 0 12px; }
}

/* 工具类补充 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--c-text-muted); }
.empty-state .icon { font-size: 46px; margin-bottom: 12px; opacity: .4; }
.divider { height: 1px; background: var(--c-border-light); margin: 16px 0; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, Monaco, "Courier New", monospace; }

/* ==================== 商品卡片 v2（按截图模板） ==================== */
.product-card-v2 {
    background: #fff;
    border: 1px solid var(--c-border-light);
    border-radius: 12px;
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all .25s;
    position: relative;
}
.product-card-v2:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
    border-color: var(--c-primary-light);
}
.pcv2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-bottom: 1px solid var(--c-border-light);
    padding-bottom: 12px;
}
.pcv2-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--c-text);
    margin: 0;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pcv2-flag {
    width: 28px;
    height: 19px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid var(--c-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pcv2-flag-fallback {
    background: #f1f5f9;
    color: var(--c-text-muted);
    font-size: 14px;
}
.pcv2-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}
.pcv2-loc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--c-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 65%;
}
.pcv2-loc i { color: var(--c-primary); }
.pcv2-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
.pcv2-specs {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pcv2-specs li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--c-border-light);
    font-size: 13px;
}
.pcv2-specs li:last-child { border-bottom: none; }
.pcv2-spec-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--c-text-muted);
}
.pcv2-spec-label i {
    color: var(--c-primary);
    width: 16px;
    text-align: center;
}
.pcv2-spec-value {
    color: var(--c-text);
    font-weight: 500;
}
.pcv2-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
}
.pcv2-price-card {
    border: 1px solid var(--c-border-light);
    border-radius: 10px;
    padding: 8px 6px;
    text-align: center;
    background: #fafbfc;
}
.pcv2-price-card.monthly {
    border-color: var(--c-primary);
    background: #eff6ff;
}
.pcv2-price-label {
    font-size: 12px;
    color: var(--c-text-muted);
    margin-bottom: 2px;
}
.pcv2-price-card.monthly .pcv2-price-label { color: var(--c-primary); }
.pcv2-price-amt {
    font-size: 18px;
    font-weight: 700;
    color: var(--c-text);
}
.pcv2-price-card.monthly .pcv2-price-amt { color: var(--c-primary); }
.pcv2-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--c-primary);
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    margin-top: 2px;
}
.product-card-v2:hover .pcv2-buy { background: var(--c-primary-dark, #1d4ed8); }

/* ===== 后台商品编辑：弹性配置分组编辑器 ===== */
.cfg-group {
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    background: var(--c-bg-light, #f8fafc);
}
.cfg-group .form-control { min-width: 0; }
[x-cloak] { display: none !important; }

/* ===== 后台渠道管理 · 上级资源：认领表单可搜索商品选择器 ===== */
.claim-picker {
    position: relative;
    display: inline-block;
}
.claim-picker-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 150px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--c-border, #d1d5db);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: inherit;
    cursor: pointer;
    text-align: left;
}
.claim-picker-toggle > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.claim-picker-caret {
    flex: none;
    font-size: 11px;
    color: var(--c-muted, #9ca3af);
}
.claim-picker-panel {
    position: fixed;
    z-index: 1000;
    width: 260px;
    border: 1px solid var(--c-border, #d1d5db);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
    overflow: hidden;
}
.claim-picker-search {
    padding: 8px;
    border-bottom: 1px solid var(--c-border, #e5e7eb);
}
.claim-picker-search input {
    width: 100%;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--c-border, #d1d5db);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}
.claim-picker-search input:focus {
    border-color: var(--c-primary, #2563eb);
}
.claim-picker-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}
.claim-picker-option {
    display: block;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 5px;
    background: none;
    font-size: 13px;
    color: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.claim-picker-option:hover {
    background: var(--c-bg-light, #f1f5f9);
}
.claim-picker-option.is-active {
    background: var(--c-primary, #2563eb);
    color: #fff;
}
.claim-picker-empty {
    padding: 10px 8px;
    font-size: 12px;
    color: var(--c-muted, #9ca3af);
    text-align: center;
}
/* 下架商品：picker 里允许看到但不能选（之前完全隐藏导致用户对着空列表懵） */
.claim-picker-option.is-disabled {
    color: var(--c-muted, #9ca3af);
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.claim-picker-option.is-disabled:hover {
    background: none;
}
.claim-picker-tag {
    flex: none;
    padding: 1px 6px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
}

/* ===== 后台渠道管理 · 上级资源：批量操作条 ===== */
.res-batch {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.res-batch__count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--c-muted, #6b7280);
}
.res-batch__count b {
    color: var(--c-primary, #2563eb);
    font-size: 14px;
}
.res-batch__link {
    padding: 0;
    border: 0;
    background: none;
    font-size: 13px;
    color: var(--c-primary, #2563eb);
    cursor: pointer;
}
.res-batch__link:hover {
    text-decoration: underline;
}
.res-batch__group {
    display: flex;
    align-items: center;
    gap: 6px;
}
.res-batch__tip {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--c-muted, #9ca3af);
}
