:root {
    --bg: linear-gradient(180deg, #fff8f3 0%, #f7f8ff 48%, #f8fbff 100%);
    --sidebar-bg: linear-gradient(180deg, rgba(255, 244, 236, 0.92) 0%, rgba(245, 247, 255, 0.96) 100%);
    --panel: rgba(255, 255, 255, 0.92);
    --panel-soft: rgba(255, 248, 243, 0.88);
    --line: rgba(255, 126, 78, 0.12);
    --text: #2b2f3a;
    --muted: #7d8395;
    --primary: #ff6f4d;
    --primary-soft: rgba(255, 111, 77, 0.1);
    --success: #16a34a;
    --danger: #dc2626;
    --shadow: 0 18px 46px rgba(57, 62, 93, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: var(--bg);
    background-attachment: fixed;
}

.hidden {
    display: none !important;
}

.portal-has-token .login-shell {
    display: none !important;
}

.portal-preload .login-shell {
    display: none !important;
}

.portal-preload .portal-shell {
    display: grid !important;
    visibility: hidden;
    pointer-events: none;
}

.portal-preload::before {
    content: '正在验证登录，请稍候…';
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    color: var(--text);
    font-size: 16px;
    background: var(--bg);
}

input,
textarea,
select,
button {
    font: inherit;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    outline: none;
    transition: 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(255, 111, 77, 0.35);
    box-shadow: 0 0 0 4px rgba(255, 111, 77, 0.09);
}

textarea {
    resize: vertical;
    min-height: 92px;
}

button {
    border: none;
    cursor: pointer;
    transition: 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

.login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(255, 188, 157, 0.34), transparent 34%),
        radial-gradient(circle at bottom right, rgba(163, 196, 255, 0.22), transparent 30%),
        linear-gradient(180deg, #fff8f3 0%, #f7f8ff 52%, #f8fbff 100%);
}

.login-card {
    width: min(520px, 100%);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    box-shadow: 0 24px 60px rgba(71, 86, 122, 0.14);
    backdrop-filter: blur(18px);
    padding: 38px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 111, 77, 0.12);
    color: #ff6f4d;
    font-size: 12px;
    letter-spacing: 0.12em;
}

.login-card h1 {
    margin: 18px 0 10px;
    font-size: 34px;
    color: #25304a;
}

.login-card p,
.helper-text,
.login-form label,
.form-message {
    color: #666666;
}

.login-form,
.form-grid {
    display: grid;
    gap: 16px;
}

.login-form label,
.form-grid label {
    display: grid;
    gap: 10px;
    font-size: 14px;
}

.primary-btn,
.ghost-btn,
.danger-btn {
    padding: 13px 18px;
    border-radius: 14px;
}

.primary-btn {
    background: linear-gradient(135deg, #ff7b55, #ff5b3d);
    color: #ffffff;
    box-shadow: 0 16px 28px rgba(255, 111, 77, 0.22);
}

.ghost-btn {
    background: rgba(255, 255, 255, 0.72);
    color: #374056;
    border: 1px solid rgba(255, 126, 78, 0.12);
}

.channel-btn--active {
    background: linear-gradient(135deg, #ff7b55, #ff5b3d);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 14px 24px rgba(255, 111, 77, 0.2);
}

.danger-btn {
    background: #fff5f5;
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.tiny-btn {
    padding: 9px 13px;
    border-radius: 12px;
    font-size: 13px;
}

.form-message {
    font-size: 13px;
}

.form-message.success {
    color: var(--success);
}

.form-message.error {
    color: var(--danger);
}

.portal-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 30px;
    padding: 24px;
    background: var(--bg);
}

.sidebar,
.panel-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.settings-group {
    min-width: 0;
    margin: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
}
.settings-group legend {
    padding: 0 10px;
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
}
.settings-group .sub-copy { margin: 0; line-height: 1.8; }
#settingsForm .settings-group label { min-width: 0; }
#settingsForm .settings-group input { min-width: 0; }

.sidebar {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 44px);
    padding: 24px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(14px);
}

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

.brand-logo {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ff7b55, #ff5b3d);
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 14px 24px rgba(255, 111, 77, 0.24);
}

.sidebar-brand h2,
.topbar h1,
.panel-head h3 {
    margin: 0;
}

.sidebar-brand h2 { font-size: 20px; line-height: 1.45; }
.sidebar-brand .brand-logo { flex: 0 0 48px; width: 48px; height: 48px; object-fit: contain; border: none; background: none; }
.login-brand-icon { width: 60px; height: 60px; margin-bottom: 14px; }
.panel-head > .inline-actions:only-child { margin-left: auto; }
.field-value { color: var(--muted); font-size: 14px; }
.field-value:empty { display: none; }
.data-summary { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.sidebar-brand p,
.topbar p,
.panel-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.sidebar-nav {
    display: grid;
    gap: 14px;
}

.portal-shell .sidebar {
    background: #263242;
    border-color: #263242;
    box-shadow: 8px 12px 30px rgba(24, 36, 52, .12);
    color: #f5f7fb;
    backdrop-filter: none;
}
.sidebar .sidebar-brand h2 { color: #f5f7fb; }
.sidebar .sidebar-brand { padding-bottom: 24px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar .nav-item { color: #d8e1ed; border: 1px solid transparent; }
.sidebar .nav-item:hover { color: #fff; background: #354356; }
.sidebar .nav-item.active { color: #fff; background: #a83e27; border-color: #d96445; box-shadow: inset 3px 0 #ffab8d; }
.sidebar .nav-item:focus-visible { outline: 2px solid #ffb095; outline-offset: 3px; }
.sidebar .sidebar-footer .ghost-btn { color: #e2e9f3; border-color: rgba(255,255,255,.22); background: transparent; }
.sidebar .sidebar-footer .ghost-btn:hover { background: #354356; border-color: rgba(255,255,255,.4); }

.nav-item {
    width: 100%;
    text-align: left;
    padding: 15px 16px;
    border-radius: 16px;
    background: transparent;
    color: var(--text);
}

.nav-item.active,
.nav-item:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #ff6f4d;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 16px;
}

.profile-box {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--muted);
    line-height: 1.8;
    border: 1px solid rgba(255, 126, 78, 0.1);
}

.main-panel {
    display: grid;
    gap: 30px;
    min-width: 0;
    align-content: start;
}

.portal-shell[data-view="parseStatsView"] .main-panel {
    gap: 16px;
    align-content: start;
}

.view-section {
    display: grid;
    gap: 22px;
    min-width: 0;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 25px 0 0;
    min-height: auto;
    max-height: none;
    overflow: visible;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.topbar-copy {
    display: grid;
    gap: 4px;
}

.topbar-copy h1 {
    font-size: 30px;
    line-height: 48px;
}

.topbar-copy p {
    max-width: 760px;
}

.topbar--compact {
    padding: 2px 2px 0 !important;
    gap: 14px !important;
    min-height: auto !important;
    max-height: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.topbar--compact .topbar-copy h1 {
    font-size: 30px !important;
    line-height: 1.2;
}

.topbar--compact .topbar-copy p {
    margin-top: 2px;
    max-width: 700px;
    line-height: 1.6;
}

.topbar .ghost-btn {
    align-self: start;
    padding: 10px 16px;
}

.topbar-actions,
.inline-actions,
.cell-actions,
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.notice-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 111, 77, 0.1);
    border: 1px solid rgba(255, 111, 77, 0.12);
    color: #cc654b;
    font-size: 13px;
    max-width: 380px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 22px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 26px 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.stat-value {
    margin-top: 14px;
    font-size: 32px;
    font-weight: 700;
}

#dashboardView .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#dashboardView .stat-card { padding: 24px 28px; position: relative; }
.dashboard-overdue { position: absolute; right: 24px; bottom: 28px; color: var(--danger); font-size: 14px; }
.dashboard-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.topbar-actions { flex-wrap: nowrap; }
.topbar-actions .dashboard-header-actions { flex-wrap: nowrap; }
.topbar-actions button { white-space: nowrap; }
.portal-shell:not([data-view="dashboardView"]) .dashboard-header-actions { display: none; }
.dashboard-work-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.dashboard-top-row { display: flex; align-items: center; gap: 24px; }
.dashboard-top-row .stats-grid { flex: 1; min-width: 0; gap: 14px; }
#dashboardView .dashboard-top-row .stat-card { padding: 18px 22px; }
#dashboardView .dashboard-top-row .stat-value { margin-top: 8px; font-size: 28px; }
.dashboard-top-row .dashboard-actions { flex: 0 0 auto; }
.dashboard-top-row .dashboard-overdue { position: static; display: block; margin-top: 4px; font-size: 12px; }
.dashboard-due-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 20px 26px; }
.dashboard-due-panel .panel-head { margin: 0; }
.dashboard-due-panel #dueCustomers { flex: 1; min-width: 200px; }
.dashboard-due-panel .empty-state { padding: 0; text-align: left; }
.dashboard-due-panel .dashboard-entry { padding: 12px 0; }
.dashboard-due-panel .dashboard-entry-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.dashboard-due-panel .dashboard-entry-actions { flex: 0 0 auto; flex-wrap: nowrap; }
.dashboard-due-panel #dueCustomersPagination { width: 100%; }
.dashboard-error-tools { display: flex; align-items: center; gap: 12px; }
.dashboard-error-tools select { width: 140px; }
.dashboard-errors-panel .panel-head { flex-wrap: wrap; }
.dashboard-error-table { table-layout: fixed; min-width: 720px; }
.dashboard-error-table th:nth-child(1) { width: 23%; }
.dashboard-error-table th:nth-child(2) { width: 42%; }
.dashboard-error-table th:nth-child(3) { width: 8%; }
.dashboard-error-table th:nth-child(4) { width: 19%; }
.dashboard-error-table th:nth-child(5) { width: 8%; }
.dashboard-error-table th { white-space: nowrap; }
.dashboard-error-table td { overflow-wrap: anywhere; line-height: 1.8; }
.dashboard-error-table td strong { color: var(--text); font-size: 14px; font-weight: 500; }
.dashboard-error-table td div { font-size: 13px; color: var(--muted); }
@media (max-width: 1500px) { .dashboard-top-row { flex-wrap: wrap; } .dashboard-top-row .stats-grid { flex-basis: 100%; } }
@media (max-width: 600px) { .dashboard-error-tools { flex-wrap: wrap; } }
.dashboard-window { font-size: 13px; color: var(--muted); }
.dashboard-entry { display: flex; align-items: center; gap: 16px; justify-content: space-between; padding: 20px 0; border-top: 1px solid var(--line); }
.dashboard-entry:first-child { border-top: 0; padding-top: 0; }
.dashboard-entry:last-child { padding-bottom: 0; }
.dashboard-entry-copy { display: grid; gap: 7px; min-width: 0; line-height: 1.65; }
.dashboard-entry-copy strong { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.dashboard-entry-copy span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.dashboard-entry-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; flex: 0 0 86px; }
.dashboard-error-count { color: var(--danger); font-size: 14px; white-space: nowrap; }
.status-warning { color: #a65d12; background: #fff2dc; white-space: nowrap; }
.dashboard-read-error { color: var(--danger); }
@media (max-width: 1200px) { .dashboard-work-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    #dashboardView .stats-grid { grid-template-columns: 1fr; }
    .dashboard-entry { gap: 10px; }
}

.dashboard-grid,
.split-layout {
    display: grid;
    gap: 30px;
}

.dashboard-grid {
    grid-template-columns: 1.15fr 1fr;
}

.roomy-grid {
    margin-top: 12px;
}

.split-layout {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
    min-width: 0;
}

.panel-card {
    padding: 30px;
    min-width: 0;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 24px;
}

.summary-highlights {
    display: grid;
    gap: 18px;
}

.highlight-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--panel-soft);
    border: 1px solid var(--line);
}

.highlight-label {
    color: var(--muted);
}

.tips-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 2.1;
}

.quick-btn {
    min-width: 120px;
    justify-content: center;
}

.section-page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 18px;
    padding: 0 4px 0;
    margin-bottom: 0;
}

.section-page-head h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
}

.section-page-head p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    max-width: 760px;
}

.compact-panel {
    padding: 18px 28px 24px;
    margin-top: 0;
}

.parse-stats-toolbar {
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 16px;
}

.parse-stats-toolbar .search-input { flex: 1 1 0; width: 0; min-width: 0; }
.parse-stats-toolbar button { flex: 0 0 auto; min-height: 46px; white-space: nowrap; }

.parse-stats-toolbar--top {
    margin-bottom: 14px;
}

.section-gap {
    margin-bottom: 26px;
}

.parse-stats-page-head {
    padding: 0 4px;
    margin-top: -2px;
    margin-bottom: -4px;
}

.parse-stats-page-head h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
}

.parse-stats-page-head p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    max-width: 760px;
}

.parse-stats-panel {
    padding-top: 22px;
}

.log-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.log-item:last-child {
    border-bottom: none;
}

.log-item p,
.log-item small {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.empty-state {
    color: var(--muted);
    padding: 18px 0;
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #ffffff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

#appsView .data-table {
    min-width: 0;
    table-layout: fixed;
}

#appsView .data-table th,
#appsView .data-table td {
    white-space: normal;
    overflow-wrap: anywhere;
}

#appsView .data-table th { white-space: nowrap; }
#appsView .data-table th:nth-child(1) { width: 15%; }
#appsView .data-table th:nth-child(2) { width: 13%; }
#appsView .data-table th:nth-child(3) { width: 22%; }
#appsView .data-table th:nth-child(4) { width: 7%; }
#appsView .data-table th:nth-child(5) { width: 15%; }
#appsView .data-table th:nth-child(6) { width: 28%; }
#appsView .data-table th, #appsView .data-table td { padding: 14px 10px; }
#appsView .status-pill { white-space: nowrap; padding: 6px 8px; }
#appsView .split-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
#appsView .panel-card { padding: 22px; }
#appsView .sticky-card .form-grid { grid-template-columns: 1fr; }
#appsView .panel-head { flex-wrap: wrap; }
#appsView .panel-head .inline-actions { flex-wrap: wrap; }
#appsView .panel-head .customer-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    width: min(100%, 610px);
    min-width: 0;
}
#appsView .customer-toolbar .search-input {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
}
#appsView .customer-toolbar button {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 46px;
}
#appsView .sticky-card .panel-head { align-items: flex-start; }
#appsView .sticky-card .panel-head .inline-actions { width: 100%; }

#appsView .cell-actions {
    flex-wrap: wrap;
    gap: 6px;
}

#appsView .cell-actions button {
    white-space: nowrap;
}

#logsView .data-table {
    min-width: 0;
    table-layout: fixed;
}

#logsView .data-table th { white-space: nowrap; }
#logsView .data-table th:nth-child(1), #logsView .data-table th:nth-child(2) { width: 13%; }
#logsView .data-table th:nth-child(3) { width: 15%; }
#logsView .data-table th:nth-child(4) { width: 20%; }
#logsView .data-table th:nth-child(5) { width: 10%; }
#logsView .data-table th:nth-child(6) { width: 8%; }
#logsView .data-table th:nth-child(7) { width: 21%; }
#logsView .data-table td { overflow-wrap: anywhere; line-height: 1.7; vertical-align: top; }
#logsView .data-table td:nth-child(5), #logsView .data-table td:nth-child(6) { white-space: nowrap; }
#logsView .panel-head { flex-wrap: wrap; }
#logsView .panel-head .inline-actions {
    flex-wrap: nowrap;
    width: min(100%, 760px);
    min-width: 0;
    gap: 12px;
}
#logsView .panel-head .search-input { flex: 1 1 0; width: 0; min-width: 0; }
#logsView .panel-head select { flex: 0 0 120px; width: 120px; min-width: 0; }
#logsView .panel-head button { flex: 0 0 auto; min-height: 46px; white-space: nowrap; }
@media (max-width: 600px) {
    #logsView .panel-head .inline-actions { gap: 6px; }
    #logsView .panel-head select { flex-basis: 96px; width: 96px; padding-left: 8px; padding-right: 8px; }
}

#resourcesView .split-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
#resourcesView .panel-card { padding: 22px; }
#resourcesView .sticky-card .form-grid { grid-template-columns: 1fr; }
#resourcesView .sticky-card .panel-head { flex-wrap: wrap; }
#resourcesView .data-table { min-width: 0; table-layout: fixed; }
#resourcesView .data-table th { white-space: nowrap; }
#resourcesView .data-table th:nth-child(1) { width: 56px; }
#resourcesView .data-table th:nth-child(2) { width: 92px; }
#resourcesView .data-table th:nth-child(3) { width: 32%; }
#resourcesView .data-table th:nth-child(5) { width: 90px; }
#resourcesView .data-table th:nth-child(6) { width: 126px; }
#resourcesView .data-table th, #resourcesView .data-table td { padding: 14px 10px; }
#resourcesView .data-table td { overflow-wrap: anywhere; line-height: 1.65; }
#resourcesView .resource-points-tag { white-space: nowrap; padding: 6px 9px; }
#resourcesView .cell-actions { flex-wrap: nowrap; gap: 6px; }
#resourcesView .cell-actions button { padding: 8px 10px; white-space: nowrap; }
#resourceBannerForm.compact-banner-form { grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.banner-image-area { display: grid; gap: 10px; font-size: 14px; }
.banner-preview-slot { position: relative; height: 134px; border: 1px dashed var(--line); border-radius: 14px; background: #fffaf7; overflow: hidden; }
.banner-preview-slot::before { content: '未设置图片'; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; }
#resourceTopPreview { position: relative; z-index: 1; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 10px; border: 0; border-radius: 0; background: #fffaf7; }
#resourceTopPreview img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
#resourceTopPreview span { display: none; }
#resourceBannerForm .banner-controls { min-width: 0; gap: 14px; }
#resourceBannerForm .banner-controls label { min-width: 0; }
#resourceBannerForm .banner-save { align-self: end; justify-self: end; min-height: 48px; }
#resourceBannerMessage:empty { display: none; }
@media (max-width: 1750px) {
    #resourcesView .split-layout { grid-template-columns: 1fr; }
    #resourcesView .sticky-card { position: static; }
    #resourcesView .sticky-card .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    #resourceBannerForm.compact-banner-form { grid-template-columns: 1fr; }
    .banner-image-area { max-width: 280px; }
    #resourcesView .sticky-card .form-grid { grid-template-columns: 1fr; }
    #resourcesView .data-table { min-width: 780px; }
}
.domain-history .data-table { min-width: 0; table-layout: fixed; }
.domain-history td { overflow-wrap: anywhere; }

#downloadDomainsView .panel-card { padding: 30px; }
.domain-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 22px; margin-bottom: 24px; }
.domain-toolbar button { flex: 0 0 auto; white-space: nowrap; }
.domain-summary { font-size: 13px; line-height: 1.8; color: var(--muted); }
#domainMessage:empty { display: none; }
#domainMessage:not(:empty) { margin-bottom: 18px; }
#downloadDomainsView .data-table { table-layout: fixed; min-width: 720px; }
#downloadDomainsView .data-table th { white-space: nowrap; }
#downloadDomainsView .data-table th, #downloadDomainsView .data-table td { padding: 18px 20px; line-height: 1.8; }
#downloadDomainsView .data-table td { overflow-wrap: anywhere; }
#downloadDomainsView .table-wrap:not(.domain-history) th:nth-child(1) { width: 40%; }
#downloadDomainsView .table-wrap:not(.domain-history) th:nth-child(2) { width: 14%; }
#downloadDomainsView .table-wrap:not(.domain-history) th:nth-child(3), #downloadDomainsView .table-wrap:not(.domain-history) th:nth-child(4) { width: 23%; }
.domain-history-title { margin: 32px 0 18px; font-size: 18px; }

@media (max-width: 1750px) {
    #appsView .split-layout { grid-template-columns: 1fr; }
    #appsView .sticky-card { position: static; }
    #appsView .sticky-card .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    #appsView .sticky-card .form-grid { grid-template-columns: 1fr; }
    #appsView .data-table { min-width: 780px; }
    #logsView .data-table { min-width: 850px; }
}

.data-table th,
.data-table td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.data-table th {
    color: #333333;
    font-weight: 600;
}

.data-table td {
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.status-success {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.status-danger {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.search-input {
    min-width: 230px;
}

.sticky-card {
    position: sticky;
    top: 10px;
}

.table-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.pagination-summary {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.pagination-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pagination-button {
    min-width: 36px;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

.pagination-button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-button.is-active,
.pagination-button.is-active:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.pagination-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
    font-size: 13px;
    color: var(--muted);
}

.pagination-jump input {
    width: 68px;
    min-width: 0;
    min-height: 36px;
    padding: 7px;
    font-size: 13px;
    border-radius: 10px;
}

#appFormTitle {
    scroll-margin-top: 20px;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.file-input {
    padding: 12px;
    background: #ffffff;
}

.upload-preview {
    margin-top: 12px;
    min-height: 80px;
    padding: 14px;
    border-radius: 14px;
    border: 1px dashed #cccccc;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
}

.upload-preview img {
    max-width: 180px;
    max-height: 180px;
    border-radius: 12px;
    display: block;
}

.upload-preview span {
    color: var(--muted);
    font-size: 13px;
}

.table-cover {
    width: 72px;
    height: 52px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.mono-text {
    max-width: 320px;
    line-height: 1.8;
    word-break: break-all;
}

.sub-copy {
    color: var(--muted);
    font-size: 12px;
}

.resource-points-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 111, 77, 0.12);
    color: #ff6f4d;
    font-size: 12px;
}

@media (max-width: 1200px) {
    .topbar { padding-top: 0; }
    .portal-shell,
    .dashboard-grid,
    .split-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
    }

    .sticky-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .portal-shell {
        padding: 16px;
    }

    .topbar,
    .panel-card,
    .sidebar,
    .login-card {
        border-radius: 20px;
    }

    .form-grid,
    .form-grid.two-columns {
        grid-template-columns: 1fr;
    }

    .topbar {
        grid-template-columns: 1fr;
        align-items: stretch;
        min-height: auto;
        max-height: none;
    }

    .section-page-head {
        grid-template-columns: 1fr;
    }
}
