body { margin: 0; background: #f5f7fb; color: #1f2937; font-family: "Segoe UI", "PingFang SC", sans-serif; }
.page { max-width: 1120px; margin: 0 auto; padding: 32px 20px 48px; }
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.header h1 { margin: 0 0 6px; font-size: 28px; }
.header p { margin: 0; color: #6b7280; }
.panel { background: #ffffff; border-radius: 10px; padding: 20px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06); margin-bottom: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 18px; }
.search-form, .generate-form, .inline-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
input, select, button, .link-button { height: 40px; border-radius: 8px; border: 1px solid #d1d5db; padding: 0 12px; font-size: 14px; box-sizing: border-box; }
input, select { background: #ffffff; color: #1f2937; }
input:focus, select:focus { outline: none; border-color: #1976d2; box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12); }
button, .link-button { border: none; background: #1976d2; color: #ffffff; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:hover { background: #1565c0; }
.link-button { background: #475569; }
.link-button:hover { background: #334155; }
.success { color: #16a34a; }
.error { color: #dc2626; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.narrow-panel { max-width: 520px; }
.empty-cell { text-align: center; color: #6b7280; padding: 26px 10px; }
.filter-panel { padding: 18px 20px; }
.filter-panel input[name="keyword"] { min-width: 260px; }
.table-panel { padding: 0; overflow: hidden; }
.table-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid #e2e8f0; background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); }
.table-tools h2 { margin: 0 0 4px; font-size: 18px; }
.table-tools p { margin: 0; color: #64748b; font-size: 13px; }
.table-help { color: #64748b; font-size: 13px; background: #eef4ff; border: 1px solid #d6e6ff; border-radius: 999px; padding: 7px 12px; white-space: nowrap; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 12px 10px; border-bottom: 1px solid #e5e7eb; text-align: left; font-size: 14px; }
td { background: #ffffff; vertical-align: middle; }
th { color: #475569; white-space: nowrap; }
.sheet-table { min-width: 1040px; }
.sheet-table thead th { background: #f8fafc; position: sticky; top: 0; z-index: 1; border-bottom: 1px solid #cbd5e1; border-right: 1px solid #e2e8f0; box-shadow: inset 0 1px 0 #ffffff; padding: 0; }
.sheet-table thead th:first-child { border-left: 1px solid #e2e8f0; }
.sheet-table thead th.sorted-column { background: #eaf3ff; border-bottom-color: #93c5fd; }
.sheet-table tbody td { border-right: 1px solid #f1f5f9; }
.sheet-table tbody td:first-child { border-left: 1px solid #f1f5f9; }
.sheet-table tbody tr:nth-child(even) td { background: #fcfdff; }
.sheet-table tbody tr:hover td { background: #f0f7ff; border-bottom-color: #bfdbfe; }
.sheet-table tbody tr:hover .sorted-cell { background: #e4f1ff; }
.sheet-table tbody td.sorted-cell { background: #f3f8ff; }
.sheet-table tbody tr:nth-child(even) td.sorted-cell { background: #edf6ff; }
.col-id { width: 64px; }
.col-key { width: 260px; }
.col-type { width: 110px; }
.col-status { width: 120px; }
.col-device { width: 170px; }
.col-time { width: 190px; }
.col-action { width: 82px; padding: 0 10px !important; text-align: center; }
.sortable-link { color: #475569; text-decoration: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; width: 100%; padding: 0 10px; font-weight: 700; box-sizing: border-box; }
.sortable-link:hover { color: #1976d2; background: #eef6ff; }
.sortable-link.active { color: #1565c0; background: #e3f0ff; }
.sort-glyph { width: 14px; min-width: 14px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; opacity: 0.42; }
.sort-glyph.active { opacity: 1; }
.sort-up, .sort-down { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.sort-up { border-bottom: 5px solid #94a3b8; }
.sort-down { border-top: 5px solid #94a3b8; }
.sort-glyph.active.asc .sort-up { border-bottom-color: #1565c0; }
.sort-glyph.active.desc .sort-down { border-top-color: #1565c0; }
.detail-link { color: #1565c0; font-weight: 600; text-decoration: none; }
.detail-link:hover { text-decoration: underline; }
.type-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 68px; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; font-size: 13px; font-weight: 600; line-height: 1; box-sizing: border-box; white-space: nowrap; }
.type-YEAR { color: #92400e; background: #fff3c4; border-color: #f7d978; }
.type-HALF_YEAR { color: #5b21b6; background: #ede9fe; border-color: #c4b5fd; }
.type-MONTH { color: #155e75; background: #dff6ff; border-color: #7dd3fc; }
.type-TRIAL { color: #166534; background: #dcfce7; border-color: #86efac; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 78px; height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid transparent; font-size: 13px; font-weight: 600; line-height: 1; box-sizing: border-box; white-space: nowrap; }
.status-UNUSED { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }
.status-ACTIVATED { color: #166534; background: #dcfce7; border-color: #86efac; }
.status-EXPIRED { color: #9a3412; background: #ffedd5; border-color: #fdba74; }
.status-DISABLED { color: #991b1b; background: #fee2e2; border-color: #fca5a5; }
@media (max-width: 760px) {
    .page { padding: 22px 12px 36px; }
    .header, .table-tools { align-items: flex-start; flex-direction: column; }
    .filter-panel input[name="keyword"] { min-width: 100%; }
    .search-form > *, .generate-form > * { width: 100%; }
    .table-help { white-space: normal; border-radius: 8px; }
}
.download-body { min-height: 100vh; background: linear-gradient(135deg, #f0f7ff 0%, #f7fafc 42%, #fff8e7 100%); }
.download-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px 16px; box-sizing: border-box; }
.download-panel { width: 100%; max-width: 430px; background: rgba(255, 255, 255, 0.92); border: 1px solid rgba(226, 232, 240, 0.9); border-radius: 18px; box-shadow: 0 20px 54px rgba(15, 23, 42, 0.12); padding: 34px 28px; text-align: center; box-sizing: border-box; }
.app-mark { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 22px; background: #facc15; color: #7c2d12; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; box-shadow: 0 12px 22px rgba(250, 204, 21, 0.28); }
.download-panel h1 { margin: 0; font-size: 30px; color: #0f172a; }
.download-subtitle { margin: 8px 0 22px; color: #64748b; }
.download-meta { margin: 0 0 24px; display: grid; gap: 10px; text-align: left; }
.download-meta div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; }
.download-meta dt { color: #64748b; font-weight: 600; }
.download-meta dd { margin: 0; color: #0f172a; font-weight: 700; word-break: break-all; text-align: right; }
.download-button { width: 100%; height: 48px; border-radius: 12px; background: #1976d2; color: #ffffff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; box-shadow: 0 12px 24px rgba(25, 118, 210, 0.2); }
.download-button:hover { background: #1565c0; }
.download-note { margin: 16px 0 0; color: #64748b; font-size: 13px; line-height: 1.6; }
@media (max-width: 480px) {
    .download-panel { padding: 28px 18px; border-radius: 14px; }
    .download-meta div { align-items: flex-start; flex-direction: column; gap: 4px; }
    .download-meta dd { text-align: left; }
}
.pagination-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 16px 20px 20px; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.page-chip { min-width: 40px; height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid #cbd5e1; background: #ffffff; color: #334155; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; box-sizing: border-box; }
.page-chip:hover { background: #eff6ff; color: #1976d2; }
.page-chip.active { background: #1976d2; border-color: #1976d2; color: #ffffff; }
.page-chip.disabled { pointer-events: none; opacity: 0.45; }
.detail-actions { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.danger-button { background: #dc2626; color: #ffffff; }
.danger-button:hover { background: #b91c1c; }
.action-cell { display: flex; gap: 8px; align-items: center; justify-content: flex-start; }
.inline-action-form { display: inline-flex; margin: 0; }
.small-button { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.detail-actions h2 { margin-bottom: 10px; }