/* ============================================================
   风云商城 - 前端样式
   ============================================================ */

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

:root {
    --bg:        #0f0e17;
    --bg2:       #1a1a2e;
    --card:      #16213e;
    --border:    #0f3460;
    --accent:    #e94560;
    --gold:      #f0a500;
    --text:      #e0e0e0;
    --muted:     #8892a4;
    --success:   #27ae60;
    --warning:   #f39c12;
    --danger:    #e74c3c;
    --radius:    10px;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Header ── */
.site-header {
    background: linear-gradient(135deg, #0f0e17 0%, #1a1a2e 100%);
    border-bottom: 2px solid var(--accent);
    padding: 20px 0;
}
.site-header .logo {
    font-size: 26px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
}
.site-header .subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

/* ── Notice Bar ── */
.notice-bar {
    background: rgba(240, 165, 0, 0.12);
    border: 1px solid rgba(240, 165, 0, 0.4);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin: 24px 0 20px;
    color: #f0a500;
    font-size: 14px;
    line-height: 1.6;
}
.notice-bar .icon { margin-right: 6px; }

/* ── Item Grid ── */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

.item-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.2);
}

.item-img {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15,52,96,.5);
    overflow: hidden;
}
.item-img img { max-height: 100%; max-width: 100%; object-fit: contain; }
.img-placeholder { font-size: 56px; }
.img-placeholder.large { font-size: 80px; }

.item-body { padding: 14px 16px; flex: 1; }
.item-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.4;
}
.item-desc {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.5;
}
.item-meta { color: var(--muted); font-size: 12px; }

.item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}
.item-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
}
.item-price.big { font-size: 28px; }

.btn-buy {
    background: linear-gradient(135deg, var(--accent), #c0392b);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .2s;
}
.btn-buy:hover { opacity: .85; color: #fff; }
.btn-sold { color: var(--muted); font-size: 14px; }

/* ── Buy Page ── */
.buy-page { padding: 30px 0 60px; }
.buy-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 700px;
    margin: 0 auto;
}

.buy-item-info {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.buy-item-img { width: 100px; flex-shrink: 0; }
.buy-item-img img { width: 100%; border-radius: 8px; }

/* ── Offline Warning ── */
.offline-warning {
    display: flex;
    gap: 14px;
    background: rgba(231,76,60,.12);
    border: 1px solid rgba(231,76,60,.5);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}
.warning-icon { font-size: 28px; flex-shrink: 0; }
.warning-text { font-size: 14px; line-height: 1.8; color: #e0e0e0; }
.warning-red { color: #e74c3c; font-size: 15px; display: block; margin-top: 6px; }

/* ── Buy Form ── */
.buy-form { margin-top: 6px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #ccc;
    font-size: 14px;
}
.form-group small { color: var(--muted); font-size: 12px; display: block; margin-top: 4px; }
.form-input {
    width: 100%;
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: #fff;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
.form-input:focus { border-color: var(--accent); }

.input-row { display: flex; gap: 10px; }
.input-row .form-input { flex: 1; }

.btn-verify {
    background: var(--border);
    border: 1px solid #1e5f8a;
    color: #7ecfff;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.btn-verify:hover { background: #1e5f8a; }

.verify-result {
    margin-top: 8px;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 4px;
    display: none;
}
.verify-result.ok  { background: rgba(39,174,96,.15); color: #2ecc71; display: block; }
.verify-result.err { background: rgba(231,76,60,.15); color: #e74c3c; display: block; }

.checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-weight: normal !important;
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
}
.checkbox-label input[type=checkbox] {
    width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; cursor: pointer;
    accent-color: var(--accent);
}

/* ── 支付方式选择 ── */
.pay-method-row {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}
.pay-method-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid #2c3e50;
    border-radius: 8px;
    cursor: pointer;
    color: #aaa;
    font-size: 14px;
    font-weight: 600;
    transition: border-color .2s, color .2s, background .2s;
    user-select: none;
    background: rgba(255,255,255,.03);
}
.pay-method-item input[type=radio] { display: none; }
.pay-method-item.selected {
    border-color: var(--accent);
    color: #fff;
    background: rgba(240,165,0,.08);
}
.pay-method-item:hover { border-color: var(--accent); color: #fff; }
.pay-icon { display: flex; align-items: center; }

.btn-pay {
    width: 100%;
    padding: 14px;
    font-size: 17px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, #27ae60, #1e8449);
    color: #fff;
    margin-top: 20px;
    transition: opacity .2s, background .2s;
}
.btn-pay:disabled {
    background: #2c3e50;
    color: var(--muted);
    cursor: not-allowed;
}
.btn-pay:not(:disabled):hover { opacity: .9; }
.pay-tip { text-align: center; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* ── Result Card ── */
.result-card {
    max-width: 560px;
    margin: 40px auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 30px;
    text-align: center;
}
.result-icon { font-size: 60px; margin-bottom: 14px; }
.result-title { font-size: 22px; margin-bottom: 10px; }
.result-msg { color: var(--muted); font-size: 15px; line-height: 1.7; margin-bottom: 20px; }

.order-info {
    text-align: left;
    background: rgba(255,255,255,.04);
    border-radius: 8px;
    padding: 16px 20px;
    margin: 0 auto 20px;
}
.order-info table { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-info td { padding: 6px 0; }
.order-info td:first-child { color: var(--muted); width: 80px; }
.order-info code { background: rgba(255,255,255,.06); padding: 2px 6px; border-radius: 3px; }

/* ── Error box ── */
.error-box {
    background: rgba(231,76,60,.12);
    border: 1px solid rgba(231,76,60,.4);
    border-radius: 8px;
    padding: 16px;
    color: #e74c3c;
    font-size: 14px;
}

/* ── Empty ── */
.empty-tip {
    text-align: center;
    color: var(--muted);
    padding: 80px 0;
    font-size: 16px;
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .item-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .buy-card { padding: 20px; }
    .buy-item-info { flex-direction: column; }
    .buy-item-img { width: 80px; }
}
@media (max-width: 400px) {
    .item-grid { grid-template-columns: 1fr; }
}
