:root {
    --bg: #0b1020;
    --card: #141c33;
    --card-soft: #1b2542;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4f7ff;
    --muted: #aeb8d3;
    --primary: #4f7cff;
    --primary-soft: rgba(79, 124, 255, 0.12);
    --success: #2fb87c;
    --warning: #ffb34d;
    --danger: #ff6b6b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(79, 124, 255, 0.16), transparent 30%),
        radial-gradient(circle at top right, rgba(47, 184, 124, 0.12), transparent 28%),
        var(--bg);
}

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

code {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.hero,
.card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.02));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.hero {
    padding: 28px;
    margin-bottom: 20px;
}

.hero h1 {
    margin: 12px 0 12px;
    font-size: 34px;
}

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

.badge {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: #b7c8ff;
    font-size: 13px;
}

.hero-actions,
.form-actions,
.toolbar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.grid.two {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid.three {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
    padding: 20px;
    margin-bottom: 16px;
}

.card h2,
.card h3 {
    margin-top: 0;
}

.card p,
.card li,
.helper,
.muted {
    color: var(--muted);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease;
}

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

.button.primary {
    background: var(--primary);
    color: #fff;
}

.button.secondary {
    background: var(--card-soft);
    color: #fff;
}

.button.ghost {
    border-color: var(--line);
    background: transparent;
    color: var(--text);
}

.button.warning {
    background: rgba(255, 179, 77, 0.15);
    color: #ffd18c;
}

.button.danger {
    background: rgba(255, 107, 107, 0.15);
    color: #ffc1c1;
}

.layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #d7dff5;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    outline: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 0 14px;
}

.field input {
    height: 42px;
}

.field select {
    height: 42px;
    padding-right: 36px;
    appearance: none;
}

.field textarea {
    min-height: 110px;
    padding-top: 12px;
    resize: vertical;
}

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

.stat {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.table-wrap {
    overflow: auto;
}

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

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

th {
    color: #d7dff5;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.tag.success { background: rgba(47, 184, 124, 0.16); color: #8ff0c2; }
.tag.warning { background: rgba(255, 179, 77, 0.18); color: #ffd18c; }
.tag.danger { background: rgba(255, 107, 107, 0.16); color: #ffc1c1; }

.list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.task-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 14px;
}

.task-card h3 {
    margin: 0 0 8px;
}

.task-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.message {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.compact-message {
    margin-top: 12px;
    padding: 9px 12px;
    font-size: 13px;
}

.hidden {
    display: none;
}

.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 16px;
}

.admin-sidebar h2 {
    margin: 14px 0 8px;
}

.admin-menu {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.admin-menu-button {
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    text-align: left;
    padding: 0 14px;
    cursor: pointer;
}

.admin-menu-button.active {
    background: var(--primary);
    border-color: transparent;
}

.admin-sidebar-actions {
    display: grid;
    gap: 12px;
}

.admin-content {
    min-width: 0;
}

.admin-section {
    display: block;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 14px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.toolbar-actions {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.toolbar-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.field.compact {
    margin-bottom: 0;
}

.action-panel {
    margin-bottom: 16px;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
}

.filter-summary {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 14px;
}

.filter-summary .muted {
    margin-left: 8px;
}

.result-panel {
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(79, 124, 255, 0.08), rgba(255, 255, 255, 0.03));
}

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

.result-panel-body {
    display: grid;
    gap: 6px;
}

.result-panel-title {
    font-size: 15px;
    color: #dfe7ff;
}

.result-panel-text {
    color: var(--muted);
    font-size: 14px;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    white-space: nowrap;
}

.result-badge.pending {
    background: rgba(255, 255, 255, 0.06);
    color: #d7dff5;
}

.result-badge.success {
    background: rgba(47, 184, 124, 0.16);
    color: #8ff0c2;
}

.result-badge.error {
    background: rgba(255, 107, 107, 0.16);
    color: #ffc1c1;
}

.pagination-bar {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    flex-wrap: wrap;
}

.pagination-meta {
    color: var(--muted);
    font-size: 14px;
}

.pagination-actions {
    display: flex;
    gap: 10px;
}

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

.more-menu {
    position: relative;
}

.more-menu summary {
    list-style: none;
}

.more-menu summary::-webkit-details-marker {
    display: none;
}

.more-menu[open] .button {
    border-color: rgba(79, 124, 255, 0.45);
    background: rgba(79, 124, 255, 0.08);
}

.more-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 12;
    min-width: 180px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #16203a;
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
    display: grid;
    gap: 6px;
}

.more-menu-item {
    width: 100%;
    min-height: 36px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 0 12px;
    cursor: pointer;
}

.more-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.button.small {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
}

@media (max-width: 760px) {
    .layout {
        grid-template-columns: 1fr;
    }

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

    .admin-sidebar {
        position: static;
    }

    .section-header {
        flex-direction: column;
    }

    .container {
        width: min(100% - 24px, 1180px);
    }
}
