:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #eef4ff;
    --surface-strong: #dce8ff;
    --ink: #162032;
    --muted: #607089;
    --line: #d8e1ef;
    --line-strong: #c5d2e6;
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: #dbeafe;
    --blue: #2563eb;
    --amber: #d97706;
    --green: #17803d;
    --danger: #b42318;
    --shadow-lg: 0 24px 60px rgba(20, 33, 62, 0.08);
    --shadow-md: 0 12px 30px rgba(20, 33, 62, 0.06);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", "Noto Sans TC", "Noto Sans", sans-serif;
    padding-top: 58px;
}

a {
    color: inherit;
}

.utility-bar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1200;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(90deg, rgba(29, 78, 216, 0.96), rgba(30, 64, 175, 0.96));
    backdrop-filter: blur(12px);
}

.utility-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.utility-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.utility-brand {
    color: #f7fbfb;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.locale-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.locale-switcher label {
    color: rgba(247, 251, 251, 0.82);
    font-size: 12px;
    font-weight: 600;
}

.locale-switcher select {
    width: auto;
    min-width: 110px;
    padding: 8px 32px 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #f7fbfb;
    font-size: 12px;
}

.locale-switcher option {
    color: var(--ink);
}

.utility-link {
    color: #f7fbfb;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
}

.utility-link:hover {
    background: rgba(255, 255, 255, 0.18);
}

.login-shell {
    min-height: calc(100vh - 58px);
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent 42%),
        var(--bg);
}

.login-panel {
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.login-brand {
    color: var(--accent-strong);
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.login-panel p {
    color: var(--muted);
    margin: 10px 0 22px;
}

.login-panel form {
    display: grid;
    gap: 10px;
}

label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 650;
}

input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    font: inherit;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(15, 110, 105, 0.12);
}

.form-error {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: #fff0f0;
    color: var(--danger);
    font-size: 14px;
}

.notice {
    margin-bottom: 14px;
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    background: #e8f7ee;
    color: var(--green);
    font-weight: 650;
}

.notice.warning {
    background: #fff3df;
    color: var(--amber);
}

.support-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 20px 16px;
}

.support-banner form {
    margin: 0;
}

.link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.table-actions form {
    margin: 0;
}

.mini-stack {
    display: grid;
    gap: 3px;
    min-width: 150px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.mini-stack span:first-child {
    color: var(--ink);
    font-weight: 700;
}

.link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.link-button.danger {
    color: #b42318;
}

.form-panel {
    max-width: 920px;
}

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

.form-grid > div {
    display: grid;
    gap: 7px;
}

select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    font: inherit;
    background: var(--surface);
}

textarea {
    width: 100%;
    min-height: 110px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    font: inherit;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

ul {
    margin-top: 7px;
}

.app-shell {
    min-height: calc(100vh - 58px);
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    background:
        linear-gradient(180deg, #172554 0%, #1e3a8a 100%);
    color: #dbe6ff;
    padding: 28px 18px;
}

.platform .sidebar {
    background:
        linear-gradient(180deg, #111c44 0%, #1e3a8a 100%);
}

.brand {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 28px;
    letter-spacing: 0.01em;
}

.sidebar nav {
    display: grid;
    gap: 6px;
}

.sidebar a {
    color: #c4d4fb;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.sidebar a.active,
.sidebar a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(2px);
}

.workspace {
    min-width: 0;
    padding: 30px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 24%),
        var(--bg);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 13px;
}

h1,
h2 {
    margin: 0;
}

h1 {
    font-size: 30px;
    letter-spacing: 0.01em;
}

h2 {
    font-size: 16px;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.button {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #ffffff;
    padding: 10px 16px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.button.secondary {
    color: var(--accent-strong);
    background: linear-gradient(135deg, #f7fbfb, var(--surface-soft));
    box-shadow: none;
    border: 1px solid var(--line);
}

.button:hover {
    transform: translateY(-1px);
    filter: saturate(1.04);
}

.button.secondary:hover {
    box-shadow: var(--shadow-md);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metrics article,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.metrics article {
    padding: 18px;
}

.metrics span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.metrics strong {
    font-size: 26px;
}

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

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

.table-wrap {
    overflow-x: auto;
    margin: 0 -2px;
    padding-bottom: 2px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

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

table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 14px;
    overflow: hidden;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 12px 8px;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-weight: 650;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status.blue {
    color: var(--blue);
    background: #e8f0ff;
}

.status.amber {
    color: var(--amber);
    background: #fff3df;
}

.status.green {
    color: var(--green);
    background: #e8f7ee;
}

.alerts {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.8;
}

@media (max-width: 900px) {
    body {
        padding-top: 96px;
    }

    .utility-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 10px 14px;
    }

    .utility-actions {
        width: 100%;
        justify-content: space-between;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .metrics,
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: column;
    }

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

    .workspace {
        padding: 20px 14px;
    }

    .support-banner {
        margin: 0 14px 14px;
        flex-direction: column;
        align-items: flex-start;
    }

    .actions {
        width: 100%;
    }

    .actions .button {
        flex: 1 1 180px;
        text-align: center;
        justify-content: center;
    }

    .panel {
        padding: 16px;
    }

    table {
        min-width: 560px;
    }
}
