/* 防伪验证系统样式 — 白色风格 */
:root {
    --bg: #f5f7fb;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --ok: #16a34a;
    --ok-bg: #f0fdf4;
    --warn: #d97706;
    --warn-bg: #fffbeb;
    --fail: #dc2626;
    --fail-bg: #fef2f2;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --mono: "Consolas", "SF Mono", "Cascadia Code", monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.55;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(22, 163, 74, 0.04), transparent);
}

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

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.page-center {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.brand h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.15rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.link-admin {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.link-admin:hover {
    color: var(--primary);
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-card h1 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
    color: var(--text);
}

.verify-card {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Form */
label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input::placeholder {
    color: #94a3b8;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.code-input {
    font-family: var(--mono);
    font-size: 1.25rem !important;
    letter-spacing: 0.2em;
    text-align: center;
    text-transform: uppercase;
}

.input-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.input-row input {
    flex: 1;
    min-width: 160px;
}

.hint {
    margin-top: 0.65rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hint.center {
    text-align: center;
}

/* 防伪查询须知 — 常显示（颜色用十六进制，避免被覆盖） */
.notice-box {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.notice-box .notice-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.85rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid #e2e8f0;
}

.notice-box .notice-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.notice-box .notice-row {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.65rem 0.75rem;
    align-items: start;
}

@media (max-width: 480px) {
    .notice-box .notice-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }
}

.notice-box .notice-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
    text-align: center;
    white-space: nowrap;
}

.notice-box .notice-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: #64748b;
}

.notice-box .notice-judge {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.notice-box .notice-line {
    margin: 0;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.6;
    border: 1px solid transparent;
}

.notice-box .notice-line strong {
    display: inline-block;
    margin-right: 0.35rem;
    font-weight: 700;
}

/* 正品特征：绿色 */
.notice-box .notice-line.is-ok {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.notice-box .notice-line.is-ok strong {
    color: #16a34a;
}

/* 风险提示：琥珀色 */
.notice-box .notice-line.is-risk {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.notice-box .notice-line.is-risk strong {
    color: #d97706;
}

.muted {
    opacity: 0.7;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-ghost {
    background: #fff;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: #cbd5e1;
    background: #f8fafc;
    text-decoration: none;
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

/* Result */
.result {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid;
}

.result-ok {
    background: var(--ok-bg);
    border-color: #bbf7d0;
}

.result-fail {
    background: var(--fail-bg);
    border-color: #fecaca;
}

.result h2,
.result h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.85rem;
    color: var(--text);
}

.result-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.65rem;
    letter-spacing: 0.03em;
}

.badge-first {
    background: var(--ok);
    color: #fff;
}

.badge-repeat {
    background: var(--warn);
    color: #fff;
}

.badge-fail {
    background: var(--fail);
    color: #fff;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
}

@media (max-width: 480px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

.info-grid dt {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.info-grid dd {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.mono {
    font-family: var(--mono);
    letter-spacing: 0.08em;
}

.warn-tip {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--warn-bg);
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #b45309;
    font-size: 0.875rem;
}

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-num {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Gen form */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 140px auto;
    gap: 0.85rem;
    align-items: end;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.invisible {
    visibility: hidden;
}

.form-actions .btn {
    height: 42px;
}

/* Codes */
.codes-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.codes-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.code-chip {
    font-family: var(--mono);
    font-size: 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.06em;
}

.hidden {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

/* Table */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.list-header .section-title {
    margin-bottom: 0;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form input {
    width: 200px;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 0.75rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    background: #f8fafc;
}

.data-table tbody tr:hover {
    background: #f1f5f9;
}

.empty {
    text-align: center !important;
    color: var(--text-muted);
    padding: 2rem !important;
}

.tag {
    display: inline-block;
    min-width: 1.5rem;
    text-align: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tag-muted {
    background: #f1f5f9;
    color: var(--text-muted);
}

.tag-warn {
    background: var(--warn-bg);
    color: var(--warn);
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    justify-content: center;
    align-items: center;
}

.page-btn {
    min-width: 5.5rem;
    text-decoration: none;
}

.page-btn.disabled,
.page-btn.disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    color: var(--text-muted);
    border-color: var(--border);
}

.page-info {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.page-jump {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.35rem;
    flex-wrap: wrap;
}

.page-jump label {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.page-jump input[type="number"] {
    width: 4.5rem;
    padding: 0.45rem 0.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.page-jump-unit {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Alert */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: var(--fail-bg);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 1.5rem;
}
