:root {
    --bg: #eef3f8;
    --panel: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #dbe3ee;
    --primary: #1d4ed8;
    --primary-dark: #1e40af;
    --cyan: #0891b2;
    --teal: #0f766e;
    --amber: #b45309;
    --rose: #be123c;
    --green: #16a34a;
    --yellow: #d97706;
    --red: #dc2626;
    --sidebar: #0d1320;
    --sidebar-2: #111b2f;
    --shadow: 0 16px 42px rgba(15, 23, 42, 0.09);
    --glow: 0 0 0 1px rgba(8, 145, 178, 0.12), 0 20px 45px rgba(8, 145, 178, 0.09);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(0deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        var(--bg);
    background-size: 28px 28px, 28px 28px, auto;
    color: var(--text);
    font-family: Arial, "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    flex: 0 0 220px;
    background:
        linear-gradient(180deg, rgba(8, 145, 178, 0.12), transparent 38%),
        linear-gradient(135deg, var(--sidebar), var(--sidebar-2));
    color: #fff;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 12px 0 34px rgba(15, 23, 42, 0.18);
}

.brand {
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 20px;
    letter-spacing: 0;
    margin-bottom: 4px;
    position: relative;
}

.brand strong::after {
    background: var(--cyan);
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(8, 145, 178, 0.9);
    content: "";
    display: inline-block;
    height: 7px;
    margin-left: 8px;
    vertical-align: middle;
    width: 7px;
}

.brand span {
    color: #9ca3af;
    font-size: 12px;
}

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

.nav a {
    border-radius: 8px;
    color: #d1d5db;
    padding: 11px 12px;
    position: relative;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav a:hover,
.nav a.active {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.nav a.active::before {
    background: var(--cyan);
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(8, 145, 178, 0.85);
    content: "";
    height: 18px;
    left: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
}

.nav a:hover {
    transform: translateX(2px);
}

.main {
    flex: 1;
    min-width: 0;
    padding: 28px;
}

.topbar {
    align-items: center;
    background:
        linear-gradient(90deg, rgba(8, 145, 178, 0.08), transparent 38%),
        rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(229, 231, 235, 0.88);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 18px;
    box-shadow: var(--glow);
    position: relative;
}

.topbar::before {
    background: linear-gradient(180deg, var(--cyan), var(--primary));
    border-radius: 8px 0 0 8px;
    content: "";
    height: 100%;
    left: -1px;
    position: absolute;
    top: 0;
    width: 4px;
}

.topbar h1 {
    font-size: 26px;
    line-height: 1.25;
    margin: 0 0 4px;
}

.topbar p {
    color: var(--muted);
    margin: 0;
}

.userbar {
    align-items: center;
    display: flex;
    gap: 12px;
    white-space: nowrap;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 16px;
    position: relative;
}

.panel::before {
    background: linear-gradient(90deg, rgba(8, 145, 178, 0.28), rgba(37, 99, 235, 0.06), transparent);
    content: "";
    height: 1px;
    left: 12px;
    position: absolute;
    right: 12px;
    top: 0;
}

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

.panel-title h2 {
    font-size: 18px;
    margin: 0;
}

.grid {
    display: grid;
    gap: 16px;
}

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

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

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

.stat {
    background:
        linear-gradient(135deg, rgba(8, 145, 178, 0.08), transparent 42%),
        var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--glow);
    min-height: 116px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.stat span {
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
}

.stat strong {
    display: block;
    font-size: 26px;
    line-height: 1.15;
}

.stat small {
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
    margin-left: 2px;
}

.stat-link {
    display: block;
}

.stat::before {
    background: var(--primary);
    border-radius: 999px;
    content: "";
    height: 8px;
    position: absolute;
    right: 16px;
    top: 16px;
    width: 8px;
}

.stat::after {
    border-bottom: 1px solid rgba(8, 145, 178, 0.18);
    border-right: 1px solid rgba(8, 145, 178, 0.18);
    bottom: 10px;
    content: "";
    height: 18px;
    position: absolute;
    right: 10px;
    width: 18px;
}

.stat:nth-child(2n)::before {
    background: var(--teal);
}

.stat:nth-child(3n)::before {
    background: var(--amber);
}

.stat:nth-child(4n)::before {
    background: var(--rose);
}

.stat-meta {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 10px;
}

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

.bulk-panel {
    margin-top: 0;
}

.bulk-panel input[type="file"] {
    background: #fff;
    min-width: 260px;
    padding: 7px 10px;
}

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

.filters input,
.filters select {
    min-width: 160px;
}

.table-wrap {
    overflow-x: auto;
}

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

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

th {
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
    background: #f9fafb;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #fbfdff;
}

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

.button,
button {
    background: linear-gradient(180deg, #2563eb, var(--primary-dark));
    border: 0;
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 13px;
    font-family: inherit;
    font-size: 14px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.button:hover,
button:hover {
    background: var(--primary-dark);
}

.button-light {
    background: #e8f7fb;
    color: #0e7490;
    box-shadow: none;
}

.button-light:hover {
    background: #dbeafe;
}

.button-danger {
    background: #fee2e2;
    color: #991b1b;
}

.button-danger:hover {
    background: #fecaca;
}

.button-muted {
    background: #f3f4f6;
    color: #374151;
    box-shadow: none;
}

.button-muted:hover {
    background: #e5e7eb;
}

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

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

.form-row.full {
    grid-column: 1 / -1;
}

label {
    color: #374151;
    font-weight: 600;
}

input,
select,
textarea {
    background: #fbfdff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.13);
    outline: none;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

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

.check-item {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 8px;
    min-height: 42px;
    padding: 10px;
}

.check-item input {
    min-height: auto;
    width: auto;
}

.alert {
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 12px 14px;
}

.quick-actions {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.quick-action {
    background:
        linear-gradient(135deg, rgba(8, 145, 178, 0.09), transparent 54%),
        var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
    min-height: 96px;
    padding: 16px;
}

.quick-action:hover {
    border-color: #67e8f9;
    background: #fbfdff;
}

.quick-action strong {
    font-size: 16px;
}

.quick-action span {
    color: var(--muted);
    font-size: 12px;
}

.insight-list {
    display: grid;
    gap: 10px;
}

.insight-item {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
}

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

.insight-item strong {
    display: block;
}

.insight-item span {
    color: var(--muted);
    font-size: 12px;
}

.status-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 16px 0;
}

.status-pill {
    align-items: center;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    min-height: 56px;
    padding: 12px;
}

.status-pill span {
    color: var(--muted);
}

.status-pill strong {
    font-size: 18px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    line-height: 1;
    padding: 6px 9px;
    white-space: nowrap;
}

.badge-green {
    background: #dcfce7;
    color: #166534;
}

.badge-yellow {
    background: #fef3c7;
    color: #92400e;
}

.badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-gray {
    background: #f3f4f6;
    color: #374151;
}

.progress-track {
    background: #e5e7eb;
    border-radius: 999px;
    height: 8px;
    min-width: 110px;
    overflow: hidden;
}

.progress-fill {
    background: var(--primary);
    height: 100%;
}

.progress-text {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.node-line {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.node {
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 82px;
    padding: 12px;
}

.node strong {
    display: block;
    margin-bottom: 10px;
}

.node.done {
    border-color: #86efac;
    background: #f0fdf4;
}

.node.running {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.node.pending {
    background: #f9fafb;
}

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

.tool-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 7px;
    justify-items: center;
    min-height: 132px;
    padding: 18px 10px;
    text-align: center;
}

.tool-item:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.tool-icon {
    align-items: center;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #374151;
    display: inline-flex;
    font-size: 22px;
    font-weight: 700;
    height: 56px;
    justify-content: center;
    width: 56px;
}

.tool-item strong {
    display: block;
}

.tool-item em {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.tree-board {
    display: grid;
    gap: 10px;
}

.tree-level {
    display: grid;
    gap: 10px;
}

.tree-level .tree-level {
    margin-left: 28px;
}

.tree-node {
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 66px;
    padding: 12px;
}

.tree-node.done {
    background: #f0fdf4;
    border-color: #86efac;
}

.tree-node.running {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.tree-node-main {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.tree-dot {
    background: #d1d5db;
    border-radius: 999px;
    flex: 0 0 12px;
    height: 12px;
    width: 12px;
}

.tree-node.done .tree-dot {
    background: var(--green);
}

.tree-node.running .tree-dot {
    background: var(--primary);
}

.tree-node-status {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
}

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

.login-page {
    align-items: center;
    background:
        linear-gradient(90deg, rgba(8, 145, 178, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(8, 145, 178, 0.08) 1px, transparent 1px),
        #eef3f8;
    background-size: 30px 30px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    background:
        linear-gradient(135deg, rgba(8, 145, 178, 0.12), transparent 42%),
        var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--glow);
    max-width: 400px;
    padding: 26px;
    width: 100%;
}

.login-card h1 {
    margin: 0 0 8px;
}

.login-card p {
    color: var(--muted);
    margin: 0 0 20px;
}

.captcha-row {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 128px;
}

.captcha-code {
    align-items: center;
    background: #111827;
    border: 0;
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 22px;
    font-weight: 700;
    justify-content: center;
    letter-spacing: 3px;
    min-height: 38px;
    user-select: none;
    width: 100%;
}

.captcha-code:hover {
    background: #1f2937;
}

@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        height: auto;
        padding: 14px 16px;
        position: static;
        width: auto;
    }

    .brand {
        margin-bottom: 12px;
    }

    .nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .nav a {
        flex: 0 0 auto;
        padding: 9px 12px;
        white-space: nowrap;
    }

    .grid-2,
    .grid-3,
    .form-grid,
    .check-grid,
    .tool-grid {
        grid-template-columns: 1fr;
    }

    .grid-4,
    .quick-actions,
    .status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .main {
        padding: 16px;
    }

    .grid-4,
    .quick-actions,
    .status-strip {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 14px;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .userbar {
        flex-wrap: wrap;
    }

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

    .tree-node,
    .tree-node-status {
        align-items: stretch;
        flex-direction: column;
    }

    .tree-level .tree-level {
        margin-left: 14px;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }
}
