/* static/style.css – shared styles for Label Tracking System */

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

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    background: #f0f2f5;
    color: #333;
    min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────────── */
header {
    background: #1a56db;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}
header h1 { margin: 0; font-size: 1.2rem; font-weight: 600; }
header nav { display: flex; align-items: center; flex: 1; }
header nav a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    margin-left: 20px;
    font-size: .95rem;
}
header nav a:hover { color: #fff; text-decoration: underline; }
header nav .nav-right { margin-left: auto; }

/* ── Card ────────────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    padding: 28px 32px;
    max-width: 620px;
    margin: 36px auto;
}
.card h2 { margin-top: 0; font-size: 1.1rem; color: #1a56db; }

/* ── Form ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 500; margin-bottom: 5px; font-size: .9rem; }
select, input[type=text], input[type=number] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .95rem;
    transition: border-color .2s;
}
select:focus, input:focus { outline: none; border-color: #1a56db; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: .95rem;
    cursor: pointer;
    font-weight: 500;
    transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn-primary { background: #1a56db; color: #fff; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }

/* ── Alert ───────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
    font-size: .9rem;
}
.alert-error { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }

/* ── Search ──────────────────────────────────────────────────── */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}
.search-bar input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
}

/* ── Result card ─────────────────────────────────────────────── */
.result-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 22px;
    margin-bottom: 14px;
}
.result-card .code-badge {
    font-family: monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a56db;
    background: #eff6ff;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 12px;
}
.result-card table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.result-card td { padding: 5px 8px; }
.result-card td:first-child { color: #6b7280; width: 35%; white-space: nowrap; }
.result-card td:last-child { font-weight: 500; }

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: .8rem;
    font-weight: 600;
}
.status-0 { background: #dbeafe; color: #1e40af; }
.status-1 { background: #dcfce7; color: #15803d; }
.status-2 { background: #fef9c3; color: #854d0e; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty { text-align: center; color: #9ca3af; padding: 40px 0; font-size: .95rem; }

/* ── Hint ────────────────────────────────────────────────────── */
.hint { font-size: .8rem; color: #6b7280; margin-top: 4px; }

/* ── Loading spinner ─────────────────────────────────────────── */
.spinner {
    display: none;
    width: 20px; height: 20px;
    border: 3px solid #d1d5db;
    border-top-color: #1a56db;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 16px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Notice / instructions card ─────────────────────────────── */
.notice-card {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 18px 24px;
    max-width: 620px;
    margin: 0 auto 36px;
}
.notice-card h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #92400e;
}
.notice-card ul {
    margin: 0;
    padding-left: 20px;
    color: #78350f;
    font-size: .88rem;
    line-height: 1.8;
}

/* ── History table ───────────────────────────────────────────── */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .87rem;
}
.history-table th {
    background: #f1f5f9;
    color: #374151;
    font-weight: 600;
    padding: 9px 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #e2e8f0;
}
.history-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}
.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: #f8fafc; }
.sub-text { font-size: .78rem; color: #6b7280; }
.batch-badge {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .85rem;
}
