html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    background-image: url('/assets/bg.jpg');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    font-family: "Microsoft YaHei", Arial, sans-serif;
}

.container {
    width: 96%;
    margin: 0 auto 20px auto;
    padding: 4px 10px 10px 10px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.table-wrapper {
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th,
td {
    border: 1px solid #555555;
    padding: 3px;
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    background-color: #333333;
    color: #FFFFFF;
}

th.col-name { width: 15%; }
th.col-time { width: 14%; }
th.col-group { width: 16%; }
th.col-intro { width: 55%; }

.intro-cell { text-align: left; }

.row-premium {
    background-color: #FFFF00;
    color: #FF0000;
    font-weight: bold;
}

.row-premium a {
    color: #FF0000;
    text-decoration: none;
}

.row-premium td { font-size: 13px; }

.row-paid {
    background-color: #FFFACD;
    color: #000000;
}

.row-paid a {
    color: #000000;
    text-decoration: none;
}

.row-free {
    background-color: #FFFFFF;
    color: #000000;
}

.row-free a {
    color: #000000;
    text-decoration: none;
}

a:hover {
    color: #0000FF;
    text-decoration: underline;
}

#page-loading {
    padding: 20px;
    color: #FFFFFF;
    text-align: center;
    font-size: 12px;
}

/* admin */
body.admin-page {
    background: #1a1f2e;
    color: #e8edf7;
}

.admin-wrap {
    width: calc(100% - 32px);
    max-width: 1560px;
    margin: 24px auto;
    padding: 0 16px;
}

.admin-card {
    background: #242b3d;
    border: 1px solid #33415f;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.admin-card h1,
.admin-card h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.admin-grid label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: #9fb0cc;
}

.admin-grid input,
.admin-grid select,
.admin-grid textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #3d4f73;
    background: #151b29;
    color: #fff;
}

.admin-grid .full { grid-column: 1 / -1; }

.btn {
    display: inline-block;
    padding: 8px 14px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
}

.btn-primary { background: #3b82f6; color: #fff; }
.btn-warn { background: #f59e0b; color: #111; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-ghost { background: #33415f; color: #fff; }

.item-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #33415f;
}

.item-row:last-child { border-bottom: 0; }

.item-row .meta {
    font-size: 12px;
    color: #9fb0cc;
    margin-top: 4px;
}

.item-row .actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.tag-on { background: #14532d; color: #86efac; }
.tag-off { background: #4c1d1d; color: #fca5a5; }
.tag-premium { background: #fef08a; color: #991b1b; }
.tag-paid { background: #fde68a; color: #78350f; }
.tag-free { background: #e5e7eb; color: #111; }
.tag-pending { background: #1e3a5f; color: #93c5fd; }
.tag-timer { background: #422006; color: #fdba74; }
.tag-super { background: #4c1d95; color: #ddd6fe; }
.tag-admin { background: #1e3a5f; color: #93c5fd; }

.field-hint {
    margin: 4px 0 0;
    font-size: 11px;
    color: #64748b;
}

.schedule-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: #94a3b8;
    min-width: 88px;
}

.schedule-cell .tag {
    margin-top: 2px;
    align-self: flex-start;
}

.admin-table th.col-schedule,
.admin-table td.col-schedule {
    width: 96px;
    min-width: 96px;
    overflow: visible;
    white-space: nowrap;
    text-align: center;
}

.login-box {
    max-width: 360px;
    margin: 80px auto;
}

.hint { color: #9fb0cc; font-size: 13px; }

.admin-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.flash {
    color: #86efac;
    font-size: 14px;
}

.form-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding-bottom: 4px;
}

.admin-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: auto;
}

.admin-table th,
.admin-table td {
    border: 1px solid #33415f;
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
    overflow: hidden;
}

.admin-table th.col-name,
.admin-table td.col-title {
    width: 28%;
    min-width: 220px;
}

.admin-table th.col-time,
.admin-table td.col-time {
    width: 9%;
    min-width: 88px;
}

.admin-table th.col-qq,
.admin-table td.col-qq {
    width: 8%;
    min-width: 90px;
}

.admin-table th.col-style,
.admin-table td.col-style {
    width: 10%;
    min-width: 96px;
}

.admin-table th.col-status,
.admin-table td.col-status {
    width: 6%;
    min-width: 64px;
    text-align: center;
}

.admin-table th.col-sort,
.admin-table td.col-sort {
    width: 5%;
    min-width: 52px;
    text-align: center;
}

.admin-table th.col-owner,
.admin-table td.col-owner {
    width: 8%;
    min-width: 80px;
    white-space: nowrap;
}

.admin-users-table {
    min-width: 640px;
}

.admin-user-form {
    margin-bottom: 8px;
}

.admin-user-grid {
    max-width: 720px;
}

.password-grid {
    max-width: 520px;
}

.admin-stats-table {
    min-width: 560px;
}

.admin-stats-table .stat-num {
    text-align: center;
    font-weight: 600;
    color: #e2e8f0;
}

.admin-stats-table .stat-active {
    color: #86efac;
}

.admin-stats-table .stat-pending {
    color: #93c5fd;
}

.admin-stats-table .stat-inactive {
    color: #fca5a5;
}

.admin-stats-table th:not(:first-child),
.admin-stats-table td:not(:first-child) {
    text-align: center;
}

.admin-table th.col-actions,
.admin-table td.col-actions {
    width: 248px;
    min-width: 248px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    padding-right: 12px;
    position: sticky;
    right: 0;
    z-index: 2;
    background: #242b3d;
    box-shadow: -6px 0 10px rgba(0, 0, 0, 0.18);
}

.admin-table thead th.col-actions {
    background: #151b29;
    z-index: 3;
}

.admin-table tbody tr:hover td.col-actions {
    background: #2a334a;
}

.admin-table th {
    background: #151b29;
    color: #cbd5e1;
    white-space: nowrap;
}

.admin-table tbody tr:hover {
    background: #2a334a;
}

.admin-table .col-title {
    white-space: normal;
    overflow: hidden;
    font-weight: 600;
    line-height: 1.35;
}

.title-main {
    font-weight: 600;
    color: #f1f5f9;
    word-break: break-word;
}

.title-intro {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 400;
    color: #94a3b8;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.admin-table .col-time,
.admin-table .col-qq {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-table .col-style .tag {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.admin-table .intro-row td {
    background: #1a2133;
    color: #9fb0cc;
    font-size: 12px;
    border-top: 0;
    padding-top: 0;
}

.intro-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.inline-form {
    display: inline-flex;
    margin: 0;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.action-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.btn-action:hover {
    opacity: 0.88;
}

.btn-edit,
.btn-del {
    background: #4b5a73;
    color: #f1f5f9;
}

.btn-warn {
    background: #f5b942;
    color: #1a1a1a;
    font-weight: 600;
}

.btn-up {
    background: #3b82f6;
    color: #fff;
    font-weight: 600;
}

.btn-del:hover {
    background: #ef4444;
    color: #fff;
    opacity: 1;
}

.main-nav {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #33415f;
}

.main-nav-item {
    flex: 1;
    max-width: 200px;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    color: #94a3b8;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.main-nav-item:hover {
    color: #e2e8f0;
}

.main-nav-item.active {
    color: #fff;
    border-bottom-color: #3b82f6;
}

.admin-nav-card {
    padding: 0 16px;
}

.section-desc {
    margin: 0 0 16px;
}

.list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tab-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    background: #1a2133;
    border: 1px solid #33415f;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s;
}

.tab-item:hover {
    background: #243049;
    color: #fff;
}

.tab-item.active {
    background: #1d4ed8;
    border-color: #3b82f6;
    color: #fff;
}

.tab-badge {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.25);
    font-size: 12px;
    text-align: center;
}

.tab-item.active .tab-badge {
    background: rgba(255, 255, 255, 0.2);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-bar input[type="text"] {
    width: 220px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #fff;
}

.list-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.list-meta h2 {
    margin: 0;
    font-size: 18px;
}

.empty-tip {
    padding: 24px 0;
    text-align: center;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #33415f;
}

.page-btn,
.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #475569;
    background: #1a2133;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 13px;
}

.page-btn:hover,
.page-num:hover {
    background: #334155;
    color: #fff;
}

.page-num.current {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    font-weight: 600;
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #94a3b8;
    padding: 0 4px;
}

/* login page */
.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.18), transparent 35%),
        radial-gradient(circle at 80% 0%, rgba(245, 158, 11, 0.12), transparent 30%),
        linear-gradient(160deg, #0f172a 0%, #111827 45%, #1e1b4b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: rgba(30, 41, 59, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 32px 28px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.login-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

.login-brand h1 {
    margin: 0;
    font-size: 22px;
    color: #f8fafc;
}

.login-brand p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #94a3b8;
}

.login-alert {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(127, 29, 29, 0.45);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
    font-size: 13px;
}

.login-success {
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(20, 83, 45, 0.45);
    border: 1px solid rgba(74, 222, 128, 0.45);
    color: #bbf7d0;
    font-size: 13px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #cbd5e1;
}

.login-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid #475569;
    background: #0f172a;
    color: #f8fafc;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.login-submit {
    width: 100%;
    margin-top: 4px;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
}

.login-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.login-footer a {
    color: #93c5fd;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.card-generated-text {
    width: 100%;
    min-height: 140px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: #f8fafc;
    color: #0f172a;
}

.card-no {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    color: #1d4ed8;
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 4px;
}
