/* ========================================
   发卡平台 - 全局样式
   ======================================== */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --bg: #e0e5ec;
    --card-bg: #e0e5ec;
    --text: #2d3436;
    --text-secondary: #636e72;
    --border: #c8d0d8;
    --radius: 14px;
    --shadow-light: -5px -5px 12px rgba(255,255,255,0.7);
    --shadow-dark: 5px 5px 12px rgba(163,177,198,0.5);
    --shadow-inset: inset 3px 3px 6px rgba(163,177,198,0.4), inset -3px -3px 6px rgba(255,255,255,0.7);
    --shadow-sm: -3px -3px 6px rgba(255,255,255,0.6), 3px 3px 6px rgba(163,177,198,0.35);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

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

/* ========================================
   Header / Navigation
   ======================================== */

.header {
    background: var(--bg);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0 16px;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
}

.logo img {
    max-height: 36px;
    width: auto;
    display: block;
}

.sidebar-header .sidebar-logo {
    max-width: 180px;
    max-height: 40px;
    display: block;
}

/* ========================================
   Header Mobile Toggle
   ======================================== */

.header-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: var(--card-bg);
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    flex-shrink: 0;
}

.header-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

.header-open .header-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.header-open .header-toggle span:nth-child(2) {
    opacity: 0;
}

.header-open .header-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ========================================
   Main Content
   ======================================== */

.main {
    padding: 32px 20px;
    min-height: calc(100vh - 120px);
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
}

/* ========================================
   Alert / Flash Messages
   ======================================== */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-success {
    background: var(--card-bg);
    color: #16a34a;
    box-shadow: var(--shadow-sm);
}

.alert-error {
    background: var(--card-bg);
    color: #dc2626;
    box-shadow: var(--shadow-sm);
}

.alert-warning {
    background: var(--card-bg);
    color: #d97706;
    box-shadow: var(--shadow-sm);
}

.alert-info {
    background: var(--card-bg);
    color: #2563eb;
    box-shadow: var(--shadow-sm);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
    box-shadow: var(--shadow-light), var(--shadow-dark);
}

.btn:hover {
    box-shadow: var(--shadow-inset);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-light), var(--shadow-dark);
}

.btn-primary:hover {
    background: var(--primary);
    box-shadow: var(--shadow-inset);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-danger:hover {
    background: var(--error);
    box-shadow: var(--shadow-inset);
}

.btn-success {
    background: #059669;
    color: #fff;
}

.btn-success:hover {
    background: #059669;
    box-shadow: var(--shadow-inset);
}

.btn-outline {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: none;
}

.btn-outline:hover {
    color: var(--primary);
    box-shadow: var(--shadow-inset);
}

.btn-disabled {
    background: var(--bg);
    color: #b2bec3;
    cursor: not-allowed;
    box-shadow: var(--shadow-inset);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ========================================
   Forms
   ======================================== */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-remember {
    margin-top: -4px;
    margin-bottom: 12px;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    outline: none;
    transition: all 0.2s;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    box-shadow: var(--shadow-inset);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    box-shadow: inset 4px 4px 8px rgba(163,177,198,0.5), inset -4px -4px 8px rgba(255,255,255,0.8);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-group input[type="checkbox"] + label,
.form-group label input[type="checkbox"] {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    font-weight: 500;
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.form-divider {
    text-align: center;
    margin: 16px 0;
    color: var(--text-secondary);
    font-size: 13px;
    position: relative;
}

.form-divider::before,
.form-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.form-divider::before {
    left: 0;
}

.form-divider::after {
    right: 0;
}

/* Radio Pay Type */
.pay-type-list {
    display: flex;
    gap: 12px;
}

.pay-type-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.pay-type-item:has(input:checked) {
    border-color: var(--primary);
    background: #eef2ff;
}

.pay-type-item input {
    accent-color: var(--primary);
}

.pay-type-label {
    font-size: 14px;
    font-weight: 500;
}

/* ========================================
   Goods Card
   ======================================== */

.goods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.goods-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    padding: 28px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s;
}

.goods-card:hover {
    box-shadow: var(--shadow-inset);
}

.goods-info {
    flex: 1;
    margin-bottom: 16px;
}

.goods-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.goods-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.goods-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.goods-price {
    font-size: 24px;
    font-weight: 700;
    color: var(--error);
}

.goods-stock {
    font-size: 12px;
    color: var(--success);
    box-shadow: var(--shadow-sm);
    padding: 4px 12px;
    border-radius: 100px;
}

.goods-stock.out {
    color: var(--error);
}

/* ========================================
   Order Form
   ======================================== */

.order-form-wrapper {
    max-width: 560px;
}

.order-goods-info {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    padding: 24px;
    margin-bottom: 24px;
}

.order-goods-info h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.order-goods-info .desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.price-row .label { color: var(--text-secondary); }
.price-row .value { font-weight: 600; }

.order-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    padding: 28px;
}

.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin: 8px 0 16px;
    border-top: 1px solid var(--border);
    font-size: 15px;
    color: var(--text-secondary);
}

.total-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--error);
}

/* ========================================
   Query Form
   ======================================== */

.query-form-wrapper {
    max-width: 500px;
}

.query-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    padding: 28px;
    margin-bottom: 24px;
}

/* ========================================
   Order Detail
   ======================================== */

.order-detail {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    padding: 28px;
    margin-top: 24px;
}

.order-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(163,177,198,0.3);
}

.order-detail-header h3 {
    font-size: 18px;
}

.order-status {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
}

.status-0 { color: var(--text-secondary); }
.status-1 { color: var(--warning); }
.status-2 { color: var(--success); }
.status-3 { color: var(--error); }
.status-4 { color: #9ca3af; }

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table tr:not(:last-child) td {
    border-bottom: 1px solid rgba(163,177,198,0.3);
}

.detail-table td {
    padding: 10px 0;
    font-size: 14px;
}

.detail-table .label { color: var(--text-secondary); width: 100px; }

.card-info-box {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-inset);
}

.card-info-box h4 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.card-info-box pre {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text);
    line-height: 1.8;
}

/* ========================================
   Pay Result
   ======================================== */

.pay-result {
    text-align: center;
    padding: 40px 20px;
    max-width: 480px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
}

.result-icon {
    font-size: 64px;
    margin-bottom: 16px;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.result-icon.success {
    background: #d1fae5;
    color: #059669;
}

.result-icon.pending {
    background: #fef3c7;
    color: #d97706;
}

.result-icon.fail {
    background: #fee2e2;
    color: #dc2626;
}

.pay-result h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.result-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.pay-result p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

.empty-state p {
    margin: 0;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    text-align: center;
    padding: 24px 20px;
    border-top: 1px solid rgba(163,177,198,0.3);
    background: var(--bg);
}

.footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========================================
   Login Page
   ======================================== */

.login-bg {
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    padding: 40px;
    width: 380px;
    max-width: 95%;
}

.login-box h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 28px;
}

.login-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ========================================
   Admin Layout (Neumorphism)
   ======================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    width: 240px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 20px 0;
    margin: 16px 0 16px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
}

.sidebar-header {
    padding: 8px 20px 16px;
    border-bottom: 1px solid rgba(163,177,198,0.3);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.sidebar-header span {
    font-size: 12px;
    color: var(--text-secondary);
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
}

.sidebar-nav a {
    display: block;
    padding: 10px 16px;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: 10px;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar-nav a:hover {
    color: var(--text);
    box-shadow: var(--shadow-light), var(--shadow-dark);
}

.sidebar-nav a.active {
    color: var(--primary);
    box-shadow: var(--shadow-inset);
    font-weight: 600;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(163,177,198,0.3);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-nav a.logout-link {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(163,177,198,0.2);
    border-radius: 0;
    font-weight: 600;
}
.sidebar-nav a.logout-link:hover {
    color: var(--error);
}

.version-info {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.admin-main {
    flex: 1;
    padding: 24px 32px;
    overflow-x: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
}

.admin-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

/* ========================================
   Stats Grid (Neumorphism)
   ======================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    padding: 24px 20px;
    text-align: center;
    transition: box-shadow 0.3s;
}

.stat-card:hover {
    box-shadow: var(--shadow-inset);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-weight: 500;
}

.stat-card.highlight .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }

/* ========================================
   Data Table (Neumorphism)
   ======================================== */

.table-wrap {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    border-bottom: 1px solid rgba(163,177,198,0.3);
}

.data-table th {
    padding: 14px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-top: 1px solid rgba(163,177,198,0.15);
    color: var(--text);
}

.data-table tr:hover td {
    box-shadow: var(--shadow-inset);
}

.data-table .actions { white-space: nowrap; }
.data-table .actions .btn { margin-right: 4px; }

.data-table .empty {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.order-no {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.card-text {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   Badge (Neumorphism)
   ======================================== */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.badge-success { background: var(--card-bg); color: var(--success); }
.badge-warning { background: var(--card-bg); color: var(--warning); }
.badge-error   { background: var(--card-bg); color: var(--error); }
.badge-info    { background: var(--card-bg); color: var(--info); }

/* ========================================
   Pagination (Neumorphism)
   ======================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--card-bg);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    transition: all 0.2s;
    font-weight: 500;
}

.pagination a:hover {
    color: var(--primary);
    box-shadow: var(--shadow-inset);
}

.pagination a.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--shadow-inset);
    font-weight: 700;
}

/* ========================================
   Filter Bar (Neumorphism)
   ======================================== */

.filter-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="search"] {
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    background: var(--bg);
    font-size: 13px;
    color: var(--text);
    outline: none;
    box-shadow: var(--shadow-inset);
}

.filter-bar select:focus,
.filter-bar input:focus {
    box-shadow: var(--shadow-inset);
}

/* ========================================
   Admin Form (Neumorphism)
   ======================================== */

.admin-form {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    padding: 28px;
    max-width: 700px;
}

fieldset {
    border: 1px solid rgba(163,177,198,0.3);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

legend {
    font-size: 15px;
    font-weight: 600;
    padding: 0 12px;
    color: var(--text);
}

/* ========================================
   Modal (Neumorphism)
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    padding: 28px;
    width: 520px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 { font-size: 18px; color: var(--text); }

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}
.modal-close:hover { color: var(--error); }

/* ========================================
   Mobile Sidebar Toggle
   ======================================== */

.sidebar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: none;
    border-radius: 10px;
    box-shadow: var(--shadow-light), var(--shadow-dark);
    cursor: pointer;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

.sidebar-open .sidebar-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.sidebar-open .sidebar-toggle span:nth-child(2) {
    opacity: 0;
}

.sidebar-open .sidebar-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.sidebar-overlay {
    display: none;
}

/* ========================================
   Responsive (Admin)
   ======================================== */

@media (max-width: 768px) {
    .admin-layout {
        position: relative;
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1050;
        margin: 0;
        border-radius: 0 var(--radius) var(--radius) 0;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar-open .sidebar {
        left: 0;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-nav {
        display: block;
        padding: 8px;
    }

    .sidebar-nav a {
        margin-bottom: 4px;
        padding: 10px 16px;
        font-size: 14px;
    }

    .admin-main { padding: 16px; padding-top: 60px; }

    .goods-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========================================
   User System - Auth Forms
   ======================================== */

.auth-form {
    max-width: 420px;
    margin: 0 auto;
    padding: 32px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 22px;
}

.auth-link {
    text-align: center;
    margin-top: 16px;
    color: #666;
    font-size: 14px;
}

.auth-link a {
    color: var(--primary);
    text-decoration: none;
}

/* ========================================
   OAuth Social Login
   ======================================== */

.oauth-section {
    margin-top: 20px;
}

.oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 16px;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(163,177,198,0.4);
}

.oauth-divider span {
    padding: 0 12px;
}

.oauth-btns {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.oauth-btn:hover {
    box-shadow: var(--shadow-inset);
}

.oauth-qq { color: #12b7f5; }
.oauth-wx { color: #07c160; }
.oauth-alipay { color: #1677ff; }

/* ========================================
   OAuth Bind List
   ======================================== */

.oauth-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oauth-bind-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.oauth-bind-icon {
    font-size: 14px;
    font-weight: 600;
    min-width: 60px;
}

.oauth-bind-status {
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
}

.oauth-bind-status.bound {
    color: var(--success);
    font-weight: 500;
}

/* ========================================
   Card
   ======================================== */

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-light), var(--shadow-dark);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid rgba(163,177,198,0.3);
}

.card-body {
    padding: 24px;
}

/* ========================================
   User System - Dashboard Layout
   ======================================== */

.user-dashboard {
    display: flex;
    gap: 24px;
}

.user-sidebar {
    width: 240px;
    flex-shrink: 0;
}

.user-content {
    flex: 1;
    min-width: 0;
}

.user-info-card {
    background: var(--card-bg);
    color: var(--text);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow-light), var(--shadow-dark);
}

.user-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 12px;
    text-transform: uppercase;
    box-shadow: var(--shadow-sm);
}
.user-avatar-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 12px;
    display: block;
    box-shadow: var(--shadow-sm);
}

.user-info-card h3 { font-size: 18px; margin-bottom: 4px; }

.user-email { font-size: 13px; color: var(--text-secondary); }

.user-balance-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-light), var(--shadow-dark);
    margin-bottom: 16px;
}

.balance-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }

.balance-value { font-size: 28px; font-weight: 700; color: var(--primary); }

.user-nav {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-light), var(--shadow-dark);
}

.user-nav a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.15s;
}

.user-nav a:hover {
    color: var(--primary);
    box-shadow: var(--shadow-inset);
}

.user-nav a.active {
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-inset);
}

/* ========================================
   Recharge
   ======================================== */

.recharge-preset {
    margin-bottom: 20px;
}

.recharge-preset p {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.preset-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-btns .btn-outline {
    background: var(--card-bg);
    border: none;
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
    box-shadow: var(--shadow-sm);
}

.preset-btns .btn-outline:hover {
    color: var(--primary);
    box-shadow: var(--shadow-inset);
}

.channel-list { display: flex; flex-wrap: wrap; gap: 12px; }

.channel-item { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }

.nav-balance {
    font-size: 12px;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
    padding: 4px 10px;
    border-radius: 10px;
    margin-left: 4px;
}

/* ========================================
   User Responsive
   ======================================== */

@media (max-width: 768px) {
    .user-dashboard {
        flex-direction: column;
    }

    .user-sidebar {
        width: 100%;
    }

    .form-inline .form-row {
        flex-direction: column;
    }

    .header nav {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--card-bg);
        border-radius: 0 0 var(--radius) var(--radius);
        box-shadow: var(--shadow-light), var(--shadow-dark);
        padding: 8px 0;
        z-index: 99;
    }

    .header-open nav {
        display: flex;
    }

    .header nav a {
        margin: 0;
        padding: 12px 20px;
        text-align: center;
        font-size: 15px;
    }

    .header nav a:not(:last-child) {
        border-bottom: 1px solid rgba(163,177,198,0.2);
    }

    .header-toggle {
        display: flex;
    }
}
