
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --primary-border: #bfdbfe;
    --accent: #4f46e5;
    --success: #059669;
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f9fafb;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.03);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --fs-xs: 0.8rem;
    --fs-sm: 0.9rem;
    --fs-base: 1rem;
    --fs-md: 1.15rem;
    --fs-lg: 1.35rem;
    --fs-xl: 1.6rem;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.65;
    font-size: var(--fs-base);
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.01em;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border-light);
    padding: 0 2.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
    letter-spacing: -0.3px;
    margin-left: 2rem;
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin-left: auto;
    margin-right: 1.5rem;
}

.topbar-links a {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.topbar-links a i {
    margin-right: 6px;
    font-size: 0.85em;
}

.topbar-links a:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.topbar-links a.active {
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 600;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 200;
    padding: 4px;
    margin-top: 4px;
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.15s ease;
}

.dropdown-menu a {
    display: block;
    padding: 8px 14px;
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: var(--fs-sm);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 8px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.page {
    max-width: 680px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
    min-height: calc(100vh - 64px);
}

.page.member-page {
    max-width: 1100px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.panel:hover {
    box-shadow: var(--shadow-md);
}

.panel-header {
    font-size: var(--fs-md);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.2px;
}

.panel-header .badge {
    font-size: var(--fs-xs);
    background: var(--primary-soft);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    letter-spacing: 0.4px;
    margin-left: auto;
}

.icon-accent {
    color: var(--primary);
    font-size: 1.1em;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    display: block;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    font-size: var(--fs-base);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.btn-paste {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px dashed var(--primary-border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.btn-paste:hover {
    background: #dbeafe;
    border-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0.65rem 1.4rem;
    font-size: var(--fs-sm);
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

.btn i {
    font-size: 0.9em;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--text-muted);
    color: var(--text);
    background: var(--surface-hover);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border: none;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 0.75rem 1.6rem;
    font-size: var(--fs-base);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.tabs .tab {
    padding: 0.6rem 1.2rem;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    margin-bottom: -1px;
    white-space: nowrap;
}

.tabs .tab i {
    margin-right: 5px;
}

.tabs .tab:hover {
    color: var(--text-secondary);
}

.tabs .tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

.alert-box {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    border: 1px solid;
}

.alert-box.error { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }
.alert-box.success { background: var(--success-soft); color: #065f46; border-color: #a7f3d0; }
.alert-box.info { background: var(--primary-soft); color: #1e40af; border-color: var(--primary-border); }

.toast-item {
    background: var(--surface);
    color: var(--text);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    margin-bottom: 8px;
    font-size: var(--fs-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.4s ease;
    border-left: 4px solid var(--primary);
}

.toast-item.success { border-left-color: var(--success); background: #f0fdf4; }
.toast-item.error { border-left-color: var(--danger); background: #fef2f2; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.paste-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
}

.paste-overlay.show { display: block; }

.paste-dialog {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 92%;
    max-width: 450px;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
}

.paste-dialog-header {
    padding: 15px 18px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.paste-dialog-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text);
    font-weight: 700;
}

.paste-dialog-close {
    background: none; border: none;
    font-size: 24px; color: var(--text-muted);
    cursor: pointer; padding: 0; line-height: 1;
}

.paste-dialog-body { padding: 8px 18px 18px; }

.paste-dialog-body textarea {
    width: 100%;
    height: 140px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-size: 14px;
    resize: none;
    outline: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
}

.paste-dialog-body textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.paste-dialog-body .hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: center;
}

.paste-dialog-body .btn-row { display: flex; gap: 8px; margin-top: 12px; }

.paste-dialog-body .btn-row button {
    flex: 1;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
}

.btn-parse { background: var(--primary); color: #fff; }
.btn-parse:hover { background: var(--primary-hover); }
.btn-parse-close { background: #f1f5f9; color: #666; }
.btn-parse-close:hover { background: #e2e8f0; }

.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-icon { font-size: 2.2rem; margin-bottom: 0.6rem; }
.modal-card h3 { font-size: var(--fs-md); font-weight: 700; margin-bottom: 0.7rem; color: var(--text); }
.modal-text { color: var(--text-secondary); font-size: var(--fs-sm); margin-bottom: 1.3rem; line-height: 1.8; }
.modal-text strong { color: var(--text); font-weight: 600; }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.query-result-title {
    font-size: var(--fs-md);
    font-weight: 700;
    margin: 1.5rem 0 0.8rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-sm);
}

.data-table th,
.data-table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--surface-hover);
    width: 110px;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-hover); }

.status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.status-used { background: var(--success); color: #fff; }
.status-unused { background: var(--warning); color: #fff; }
.status-frozen {background: #94a3b8;color: #fff;
}

.notice-box {
    margin-top: 1.2rem;
    padding: 1rem 1.2rem;
    background: var(--warning-soft);
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    color: var(--text-secondary);
    line-height: 2;
}

.notice-box .notice-title {
    font-weight: 700;
    color: var(--warning);
    margin-bottom: 4px;
    font-size: var(--fs-sm);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.product-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: var(--surface);
}

.product-item:hover {
    border-color: var(--primary-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-thumb {
    aspect-ratio: 1 / 1;     
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f0fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    border-bottom: 1px solid var(--border-light);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;      
}

.product-meta { padding: 1rem 1.2rem; text-align: center; }
.product-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.product-price { font-size: var(--fs-md); font-weight: 700; color: var(--primary); margin-top: 2px; }

.stock-tag {
    position: absolute;
    top: 10px; right: 10px;
    background: var(--success);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.stock-tag.out { background: var(--danger); }

.member-layout {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.member-nav {
    width: 260px;
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 0.7rem;
    box-shadow: var(--shadow-xs);
    position: sticky;
    top: 76px;
}

.member-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.6rem 0.85rem;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1px;
}

.member-nav a i { width: 18px; text-align: center; font-size: 0.9em; }

.member-nav a:hover { background: var(--surface-hover); color: var(--text); }
.member-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.member-nav .nav-balance {
    margin-top: 0.5rem;
    padding: 0.7rem 0.85rem;
    border-top: 1px solid var(--border-light);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    text-align: center;
}

.member-nav .nav-balance strong {
    color: var(--primary);
    font-size: var(--fs-md);
    font-weight: 700;
}

.member-content {
    flex: 1;
    min-width: 0;
}

.profile-actions {
    display: flex;
    gap: 8px;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .topbar { padding: 0 1rem; height: 56px; }
    .topbar-links { margin-right: 0.5rem; }
    .topbar-links a { padding: 6px 10px; font-size: var(--fs-xs); }
    .topbar-links a i { display: none; }
    .page { padding: 1.2rem 1rem 2.5rem; }
    .page.member-page { max-width: 100%; }
    .panel { padding: 1.3rem; border-radius: var(--radius); }
    .product-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
    .product-thumb { font-size: 2.4rem; }

    .member-layout {
        flex-direction: column;
        gap: 0.8rem;
    }
    .member-nav {
        width: 100%;
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 3px;
        padding: 0.5rem;
        border-radius: var(--radius);
    }
    .member-nav a { padding: 0.5rem 0.8rem; font-size: var(--fs-xs); }
    .member-nav .nav-balance { display: none; }
    .member-content { width: 100%; }

    .tabs .tab { padding: 0.5rem 0.8rem; font-size: var(--fs-xs); }
    .modal-card { padding: 1.5rem; }
    .paste-dialog { width: 94%; }
    .data-table th, .data-table td { padding: 0.6rem 0.7rem; font-size: var(--fs-sm); }
}

@media (max-width: 480px) {
    .topbar-links a span { display: none; }
    .topbar-links a i { display: inline; }
    .product-grid { grid-template-columns: 1fr; }
    .product-thumb { font-size: 2.8rem; }
    .form-control { font-size: var(--fs-sm); padding: 0.6rem 0.8rem; }
    .btn { padding: 0.55rem 1.1rem; }
}
}