:root {
    --zib-bg: #f5f7fb;
    --zib-card: rgba(255, 255, 255, 0.92);
    --zib-text: #111827;
    --zib-muted: #64748b;
    --zib-primary: #2f6bff;
    --zib-primary-2: #7c3aed;
    --zib-border: rgba(148, 163, 184, 0.22);
    --zib-shadow: 0 18px 46px rgba(15, 23, 42, 0.10);
    --zib-radius: 22px;
}

body {
    background:
        radial-gradient(circle at 18% 0%, rgba(47, 107, 255, 0.14), transparent 28%),
        radial-gradient(circle at 85% 12%, rgba(124, 58, 237, 0.10), transparent 25%),
        linear-gradient(180deg, #f8fbff 0%, var(--zib-bg) 62%, #ffffff 100%);
    color: var(--zib-text);
}

/* ===== Sidebar ===== */
aside {
    background:#0f172a;
    color:white;
    padding:22px;
    position:sticky;
    top:0;
    height:100vh
}

aside h2 {
    margin:0 0 20px
}

aside a {
    display:block;
    color:#cbd5e1;
    text-decoration:none;
    padding:12px 14px;
    border-radius:14px;
    margin:4px 0
}

aside a:hover {
    background:#1e293b;
    color:white
}

aside a.active {
    background:rgba(99,102,241,.2);
    color:#fff;
    font-weight:600
}

.sidebar-version {
    margin-top:24px;
    padding:12px 14px;
    border-top:1px solid rgba(255,255,255,.08);
    display:flex;
    flex-direction:column;
    gap:2px
}
.sidebar-version .ver-name {
    font-size:12px;
    color:#94a3b8;
    font-weight:500
}
.sidebar-version .ver-status {
    font-size:11px;
    color:#64748b
}

@media (max-width: 900px) {
    aside { position: static; min-height: auto; border-radius: 0 0 22px 22px }
    .sidebar-nav { max-height: 340px }
}

header,
.card,
.stats div,
.admin-login,
.toolbar a {
    background: var(--zib-card);
    border: 1px solid var(--zib-border);
    border-radius: var(--zib-radius);
    box-shadow: var(--zib-shadow);
    backdrop-filter: blur(14px);
}

header b,
.card h2 {
    letter-spacing: 0.01em;
}

.card h2 {
    position: relative;
    padding-left: 12px;
}

.card h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.28em;
    width: 4px;
    height: 1em;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--zib-primary), var(--zib-primary-2));
}

.stats b {
    background: linear-gradient(135deg, var(--zib-primary), var(--zib-primary-2));
    -webkit-background-clip: text;
    color: transparent;
}

.table p:first-child {
    background: linear-gradient(135deg, #0f172a, #1e3a8a);
}

.table p:not(:first-child) {
    border: 1px solid rgba(148, 163, 184, 0.14);
    transition: background 0.18s ease, transform 0.18s ease;
}

.table p:not(:first-child):hover {
    background: rgba(47, 107, 255, 0.06);
    transform: translateY(-1px);
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-search input,
.admin-search select,
.ticket textarea,
.ticket select {
    border-radius: 16px;
    border-color: var(--zib-border);
}

.admin-form button,
.ticket button,
.table button,
.admin-login button {
    border-radius: 999px;
    background: linear-gradient(135deg, var(--zib-primary), var(--zib-primary-2));
}

.export-link,
.pager a {
    border-radius: 999px;
}

/* 后台页面级 UI 细化：控制台、表格、表单、筛选、分页 */
.admin main {
    background:
        radial-gradient(circle at 82% 0%, rgba(47, 107, 255, 0.08), transparent 26%),
        transparent;
}

.admin main > * {
    animation: xy-admin-in 0.24s ease both;
}

@keyframes xy-admin-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    position: sticky;
    top: 16px;
    z-index: 5;
    min-height: 64px;
}

header span {
    color: var(--zib-muted);
}

header a {
    color: var(--zib-primary);
    font-weight: 800;
}

.stats {
    gap: 16px;
}

.stats div {
    position: relative;
    overflow: hidden;
    min-height: 112px;
}

.stats div::after {
    content: "";
    position: absolute;
    right: -22px;
    bottom: -28px;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: rgba(47, 107, 255, 0.08);
}

.stats span {
    color: var(--zib-muted);
    font-weight: 700;
}

.stats b {
    position: relative;
    z-index: 1;
    font-size: 34px;
    letter-spacing: -0.04em;
}

.card {
    margin-bottom: 18px;
    padding: 22px;
}

.card > p {
    color: var(--zib-muted);
    line-height: 1.72;
}

.table {
    display: grid;
    gap: 8px;
}

.table p {
    align-items: center;
    border-radius: 16px;
}

.table p:first-child {
    min-height: 46px;
    color: #ffffff;
    font-weight: 900;
}

.table p:not(:first-child) {
    min-height: 48px;
    background: rgba(255, 255, 255, 0.78);
}

.table span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.table a {
    color: var(--zib-primary);
    font-weight: 800;
}

.table button {
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(47, 107, 255, 0.18);
}

.admin-form {
    display: grid;
    gap: 14px;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.admin-search input,
.admin-search select,
.ticket textarea,
.ticket select {
    min-height: 42px;
    padding: 0 13px;
    background: rgba(255, 255, 255, 0.92);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.admin-form textarea,
.ticket textarea {
    min-height: 110px;
    padding-top: 12px;
    resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus,
.admin-search input:focus,
.admin-search select:focus,
.ticket textarea:focus,
.ticket select:focus {
    outline: none;
    border-color: rgba(47, 107, 255, 0.58);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.10);
}

.admin-form button,
.ticket button,
.admin-login button {
    min-height: 42px;
    border: 0;
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(47, 107, 255, 0.22);
}

.admin-search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(47, 107, 255, 0.05);
}

.admin-search button,
.admin-search a,
.export-link,
.pager a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-weight: 850;
}

.admin-search button {
    border: 0;
    color: #ffffff;
    background: linear-gradient(135deg, var(--zib-primary), var(--zib-primary-2));
}

.admin-search a,
.export-link,
.pager a {
    color: var(--zib-primary);
    background: rgba(47, 107, 255, 0.09);
}

.pager {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.admin-login {
    max-width: 420px;
    margin: 8vh auto;
    padding: 34px;
}

.admin-login h1 {
    margin-top: 0;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.admin-login input {
    min-height: 46px;
}

.ticket {
    display: grid;
    gap: 14px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.toolbar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    color: var(--zib-primary);
    font-weight: 850;
}

.table.cols8 p {
    grid-template-columns: 50px 1fr 70px 1fr 60px 72px 1fr 240px;
}

.inline-actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    align-items: center;
}

.inline-actions form {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.inline-actions .ship-form input {
    width: 80px;
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid var(--zib-border);
    border-radius: 8px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.92);
}

.inline-actions .ship-form input:focus {
    outline: none;
    border-color: rgba(47, 107, 255, 0.58);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.10);
}

.inline-actions button {
    min-height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    transition: 0.18s ease;
}

.inline-actions form:not(.ship-form) button {
    background: linear-gradient(135deg, var(--zib-primary), var(--zib-primary-2));
    box-shadow: 0 4px 12px rgba(47, 107, 255, 0.18);
}

.inline-actions form:not(.ship-form) button:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

.inline-actions .ship-form button {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.18);
}

.inline-actions .ship-form button:hover {
    filter: brightness(0.96);
    transform: translateY(-1px);
}

.table .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.table .status-badge.paid {
    background: #fef3c7;
    color: #92400e;
}

.table .status-badge.shipped {
    background: #dbeafe;
    color: #1e40af;
}

.table .status-badge.finished {
    background: #d1fae5;
    color: #065f46;
}

.table .status-badge.closed {
    background: #e5e7eb;
    color: #4b5563;
}

.muted-status {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    min-height: 30px;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.12);
    color: var(--zib-muted);
    font-size: 12px;
    font-weight: 700;
}

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

    aside {
        position: static;
        min-height: auto;
        border-radius: 0 0 24px 24px;
    }

    header {
        position: static;
    }

    .table p {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* 后台 PHP 模板结构升级配套样式 */
.admin-page-head {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    padding: 24px;
    border: 1px solid var(--zib-border);
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.76)),
        radial-gradient(circle at 92% 0%, rgba(47, 107, 255, 0.16), transparent 28%);
    box-shadow: var(--zib-shadow);
}

.admin-page-head::after {
    content: "";
    position: absolute;
    right: -46px;
    bottom: -52px;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.10);
}

.admin-page-head h1 {
    position: relative;
    z-index: 1;
    margin: 8px 0;
    font-size: 30px;
    font-weight: 950;
    letter-spacing: -0.05em;
}

.admin-page-head p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--zib-muted);
    line-height: 1.72;
}

.admin-eyebrow {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--zib-primary);
    background: rgba(47, 107, 255, 0.10);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.14em;
}

.card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.card-title-row h2 {
    margin: 0 0 6px;
}

.card-title-row p {
    margin: 0;
    color: var(--zib-muted);
    line-height: 1.6;
}

.card-title-row > a,
.card-title-row .export-link {
    white-space: nowrap;
}

.list-card,
.form-card,
.ticket-admin-card,
.settings-card,
.permission-card {
    position: relative;
    overflow: hidden;
}

.rich-stats div {
    display: grid;
    align-content: center;
    gap: 8px;
}

.overview-card {
    border-color: rgba(47, 107, 255, 0.18);
}

.status-toolbar a {
    min-height: 40px;
    padding: 0 15px;
    color: var(--zib-primary);
    background: rgba(47, 107, 255, 0.08);
}

.status-toolbar a:hover {
    color: #ffffff;
    background: linear-gradient(135deg, var(--zib-primary), var(--zib-primary-2));
}

.form-card .admin-form {
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.54);
}

.list-card .table {
    overflow-x: auto;
}

.ticket-admin-card .ticket {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.70);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.ticket-admin-card .ticket b {
    display: block;
    margin: 8px 0;
    font-size: 16px;
}

.ticket-admin-card .ticket small {
    display: block;
    margin-bottom: 12px;
    color: var(--zib-muted);
}

.ticket-admin-card .batch-form > button {
    margin-bottom: 14px;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.check-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
}

.check-row small {
    grid-column: 2;
    color: var(--zib-muted);
}

.rich-admin-login .admin-eyebrow {
    margin-bottom: 12px;
}

.admin-error-card {
    text-align: center;
}

.admin-error-card .export-link {
    margin-top: 12px;
}

@media (max-width: 900px) {
    .card-title-row {
        flex-direction: column;
    }

    .check-grid {
        grid-template-columns: 1fr;
    }

    .admin-page-head h1 {
        font-size: 26px;
    }
}

.form-checkbox {
    display:flex;
    align-items:center;
    gap:8px;
    padding:8px 0;
    cursor:pointer;
    color:#334155;
    font-size:13px;
}
.form-checkbox input[type=checkbox] {
    width:16px;
    height:16px;
    accent-color:#6366f1;
}
