:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --primary: #2563eb;
    --success: #16a34a;
    --danger: #dc2626;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",Arial,sans-serif;
}
a { color: var(--primary); text-decoration: none; }
.container { width: min(1100px, 94vw); margin: 0 auto; }
.topbar {
    background: #0f172a;
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.topbar .inner { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand { font-size: 20px; font-weight: 700; }
.nav { display:flex; gap:14px; flex-wrap:wrap; }
.nav a { color:#cbd5e1; }
.nav a.active, .nav a:hover { color:#fff; }
.page { padding: 24px 0 40px; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 10px 24px rgba(15,23,42,.05);
}
.grid { display:grid; gap:18px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.stat-number { font-size: 30px; font-weight: 700; margin-top: 8px; }
.label { color: var(--muted); font-size: 13px; }
h1,h2,h3 { margin: 0 0 16px; }
form { display:grid; gap:14px; }
.form-group { display:grid; gap:8px; }
input[type="text"], input[type="password"], input[type="number"], textarea, select {
    width:100%;
    border:1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    background:#fff;
}
textarea { min-height: 90px; resize: vertical; }
button, .btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:none;
    border-radius: 12px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor:pointer;
}
.btn-primary, button { background:var(--primary); color:#fff; }
.btn-gray { background:#e5e7eb; color:#111827; }
.btn-danger { background:var(--danger); color:#fff; }
.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
}
.alert-success { background: #ecfdf5; color:#166534; border:1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color:#991b1b; border:1px solid #fecaca; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse: collapse; background:#fff; }
th, td { padding: 8px; border-bottom: 1px solid var(--border); text-align:left; font-size:14px; }
.badge {
    display:inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
}
.thumb { width:82px; height:82px; object-fit:contain; border:1px solid var(--border); border-radius: 10px; background:#fff; }
.login-wrap { min-height:100vh; display:grid; place-items:center; padding:20px; }
.login-card { width:min(450px, 94vw); }
.front-page {
    min-height: 100svh;
    position: relative;
    padding-bottom: calc(42px + var(--safe-bottom));
}
.front-wrap {
    min-height: calc(100svh - 42px - var(--safe-bottom));
    display:grid;
    place-items:center;
    padding:16px 12px 18px;
}
.front-card {
    width:min(460px, calc(100vw - 24px));
    background:#fff;
    border-radius:24px;
    padding:26px 18px 22px;
    transform: translateY(-34px);
    border:1px solid var(--border);
    box-shadow:0 18px 50px rgba(15,23,42,.08);
    text-align:center;
}
.front-title {
    font-size:26px;
    font-weight:700;
    margin:0 0 14px;
    line-height:1.25;
}
.qr-box {
    margin: 0 auto 16px;
    width: min(336px, 82vw);
    min-height: 160px;
    border:1px solid var(--border);
    border-radius: 18px;
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    padding: 8px;
    overflow: hidden;
}
.qr-box img {
    display:block;
    max-width:100%;
    width:auto;
    height:auto;
    max-height:min(52svh, 520px);
    object-fit:contain;
}
.current-name {
    margin-top: -4px;
    font-size: 13px;
}
.footer-text { color:var(--muted); font-size:13px; line-height:1.6; }
.small { font-size:13px; color:var(--muted); }
.actions { display:flex; gap:8px; flex-wrap:wrap; }
.front-bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.8em;
    padding: 8px 14px calc(8px + var(--safe-bottom));
    background: rgba(246, 248, 251, 0.96);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(229, 231, 235, 0.9);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}
.bottom-left,
.bottom-right {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
}
.bottom-left { text-align: right; }
.bottom-right { text-align: left; }
.bottom-right a { color: inherit; text-decoration: underline; }
.bottom-right a:hover { opacity: .9; }
@media (max-width: 860px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .front-card {
        border-radius: 22px;
        padding: 24px 14px 20px;
        transform: translateY(-28px);
    }
    .front-title {
        font-size: 24px;
        margin-bottom: 14px;
    }
    .qr-box {
        width: min(100%, 336px);
        padding: 8px;
        border-radius: 16px;
    }
    .front-bottom-bar {
        font-size: 11px;
        gap: 1.5em;
        padding-left: 10px;
        padding-right: 10px;
    }
}




.qrcode-table {
    width: 100%;
    min-width: 1060px;
    table-layout: fixed;
}
.qrcode-table .col-id { width: 56px; }
.qrcode-table .col-preview { width: 116px; }
.qrcode-table .col-name { width: 230px; }
.qrcode-table .col-sort { width: 120px; }
.qrcode-table .col-status { width: 130px; }
.qrcode-table .col-time { width: 190px; }
.qrcode-table .col-actions { width: 290px; }

.qrcode-table th,
.qrcode-table td {
    padding: 16px 10px;
    vertical-align: middle;
}
.qrcode-table th {
    white-space: nowrap;
}
.qrcode-table .cell-id {
    width: 56px;
}
.qrcode-table .cell-preview {
    width: 116px;
}
.qrcode-table .thumb {
    width: 84px;
    height: 84px;
}
.qr-name-input {
    width: 100%;
    min-width: 0;
}
.cell-sort {
    width: 120px;
}
.qr-sort-input {
    width: 92px;
    min-width: 92px;
    text-align: center;
}
.cell-status {
    width: 130px;
}
.qr-status-select {
    width: 104px;
    min-width: 104px;
    padding-right: 34px;
}
.updated-time {
    min-width: 0;
    line-height: 1.6;
    word-break: break-word;
}
.cell-actions {
    min-width: 0;
}
.actions-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.file-wrap {
    max-width: 100%;
}
.file-input-compact {
    max-width: 100%;
    font-size: 13px;
}
.buttons-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}
.inline-form {
    display: inline-flex;
    margin: 0;
}
.cell-actions button,
.buttons-row button,
.btn-save-compact,
.btn-delete-compact {
    width: auto !important;
    min-width: 76px;
    padding: 10px 20px;
    line-height: 1.2;
    border-radius: 12px;
    white-space: nowrap;
}
.btn-delete-compact {
    min-width: 76px;
}


.notice-card {
    margin-bottom: 18px;
    border: 1px solid #fde68a;
    background: linear-gradient(180deg, #fffdf4 0%, #ffffff 100%);
}
.notice-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: 800;
    color: #92400e;
}
.notice-title::before {
    content: "!";
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f59e0b;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    flex: 0 0 22px;
}
.notice-body {
    color: #7c2d12;
    line-height: 1.9;
    font-size: 14px;
}
.notice-body p { margin: 0 0 10px; }
.notice-body p:last-child { margin-bottom: 0; }
.notice-inline {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px dashed #fcd34d;
    border-radius: 14px;
    background: #fffbeb;
    color: #92400e;
    font-size: 13px;
    line-height: 1.8;
}
.notice-inline strong { color: #78350f; }

