:root {
    --bg: #f5f7fb;
    --paper: #ffffff;
    --paper-soft: #fbfcff;
    --text: #151b2c;
    --muted: #667085;
    --line: #e7ebf2;
    --blue: #1687ff;
    --blue-soft: #e8f3ff;
    --gold: #f7c86a;
    --gold-soft: #fff7e6;
    --danger: #d92d20;
    --green: #0f766e;
    --shadow: 0 18px 45px rgba(29, 41, 57, 0.08);
    font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 9% 4%, rgba(22, 135, 255, 0.11), transparent 13rem),
        linear-gradient(180deg, #f8fafc 0%, var(--bg) 42%, #f8fafc 100%);
}

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

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

.disk-app {
    width: min(100%, 1560px);
    margin: 0 auto;
    min-height: 100vh;
    padding: 30px clamp(20px, 6vw, 96px) 54px;
    display: flex;
    flex-direction: column;
}

.disk-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    margin-bottom: 34px;
}

.disk-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.logo-tile {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(29, 41, 57, 0.08);
    overflow: hidden;
    color: #111827;
    font-size: 22px;
    font-weight: 900;
}

.disk-brand strong {
    display: block;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: 0;
}

.disk-brand small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.menu-button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: var(--blue-soft);
    display: grid;
    place-items: center;
    gap: 4px;
    cursor: pointer;
}

.menu-button span {
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--blue);
}

.quick-menu {
    position: absolute;
    right: 0;
    top: 58px;
    min-width: 150px;
    padding: 8px;
    display: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
    z-index: 10;
}

.quick-menu.is-open {
    display: grid;
}

.quick-menu a {
    padding: 10px 12px;
    border-radius: 7px;
    color: #344054;
    font-size: 14px;
}

.quick-menu a:hover {
    background: #f5f8ff;
    color: var(--blue);
}

.home-strip,
.ad-panel,
.disk-panel,
.admin-card,
.login-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.home-strip {
    min-height: 172px;
    margin-bottom: 28px;
    padding: 38px 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.home-strip p,
.ad-copy p,
.panel-toolbar p,
.eyebrow {
    margin: 0;
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
}

.home-strip h1,
.ad-copy h1 {
    margin: 8px 0 10px;
    font-size: clamp(32px, 3.4vw, 44px);
    line-height: 1.18;
    letter-spacing: 0;
}

.home-strip span,
.ad-copy span {
    color: var(--muted);
    font-size: 16px;
    line-height: 1.75;
}

.strip-stats {
    min-width: 132px;
    padding: 22px 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #fff7e6, #eef7ff);
    text-align: center;
}

.strip-stats strong {
    display: block;
    font-size: 34px;
}

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

.ad-panel {
    min-height: 228px;
    margin-bottom: 30px;
    padding: 42px clamp(26px, 4vw, 58px);
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.1fr);
    gap: 48px;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.ad-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(22, 135, 255, 0.06), transparent 42%),
        linear-gradient(315deg, rgba(247, 200, 106, 0.16), transparent 48%);
    pointer-events: none;
}

.ad-copy,
.ad-card {
    position: relative;
}

.ad-card {
    border: 1px solid rgba(22, 135, 255, 0.22);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.74);
    overflow: hidden;
}

.select-bar {
    width: 100%;
    min-height: 64px;
    border: 1px solid var(--blue);
    border-radius: 8px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #101828;
    background: #ffffff;
    cursor: pointer;
}

.select-bar span {
    font-size: 19px;
}

.select-bar i {
    width: 10px;
    height: 10px;
    border-right: 2px solid #667085;
    border-bottom: 2px solid #667085;
    transform: rotate(45deg);
}

.download-method {
    min-height: 96px;
    padding: 26px 24px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.download-method strong {
    font-size: 20px;
    font-weight: 700;
}

.download-method a {
    border: 2px solid #ff3b30;
    border-radius: 6px;
    padding: 8px 20px;
    color: #151b2c;
    background: #ffffff;
    font-size: 18px;
}

.ad-card p {
    margin: 0;
    padding: 0 24px 24px;
    color: #ff3b30;
    font-size: 15px;
    line-height: 1.7;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 24px 8px;
    color: #344054;
    font-size: 16px;
}

.breadcrumb a {
    font-weight: 700;
}

.breadcrumb strong {
    font-weight: 700;
}

.disk-panel {
    overflow: hidden;
}

.panel-toolbar {
    min-height: 96px;
    padding: 26px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid #f0f3f8;
}

.panel-toolbar h2 {
    margin: 7px 0 0;
    font-size: 22px;
}

.disk-search {
    width: min(100%, 380px);
    height: 52px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--paper-soft);
}

.disk-search span {
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
}

.disk-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
}

.disk-table {
    display: grid;
}

.table-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 180px 260px;
    align-items: center;
    min-height: 70px;
    padding: 0 30px;
    gap: 22px;
}

.table-head {
    min-height: 58px;
    color: #53627a;
    background: #ffffff;
    font-size: 14px;
    font-weight: 800;
}

.data-row {
    color: #1d2939;
    border-top: 1px solid transparent;
}

.data-row:hover {
    background: #f7f9fc;
}

.data-row:nth-child(odd) {
    background: #fbfcfe;
}

.data-row:nth-child(odd):hover {
    background: #f4f8ff;
}

.name-cell {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.name-cell span {
    min-width: 0;
}

.name-cell strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.35;
}

.name-cell small {
    display: block;
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.disk-icon {
    flex: 0 0 auto;
}

.folder-icon {
    width: 29px;
    height: 22px;
    border-radius: 4px;
    background: var(--blue);
    position: relative;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.folder-icon::before {
    content: "";
    position: absolute;
    left: 3px;
    top: -6px;
    width: 13px;
    height: 8px;
    border-radius: 4px 4px 0 0;
    background: var(--blue);
}

.file-icon {
    width: 32px;
    height: 36px;
    border-radius: 5px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(180deg, var(--blue), #0b70df);
    font-size: 13px;
    font-style: normal;
    font-weight: 900;
}

.empty-row {
    padding: 62px 24px;
    text-align: center;
    color: var(--muted);
}

.empty-row strong {
    display: block;
    margin-bottom: 8px;
    color: #1d2939;
}

.empty-row p {
    margin: 0;
}

.disk-footer {
    margin-top: auto;
    padding: 64px 0 8px;
    display: flex;
    justify-content: center;
    gap: 10px;
    color: #1d2939;
    font-size: 14px;
}

.disk-footer a {
    color: #1d2939;
}

.is-hidden {
    display: none;
}

.admin-body {
    background:
        linear-gradient(180deg, #f8fafc 0%, #f5f7fb 42%, #ffffff 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}

.login-card {
    width: min(100%, 420px);
    padding: 26px;
}

.brand-mark {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow);
    margin: 0 auto 14px;
}

.brand-mark span {
    color: #111827;
    font-size: 32px;
    font-weight: 900;
}

.brand-mark.small {
    width: 64px;
    height: 64px;
}

.login-card h1 {
    text-align: center;
    margin: 0 0 6px;
    font-size: 24px;
}

.login-card p {
    margin: 0 0 16px;
    text-align: center;
    color: var(--muted);
}

.admin-shell {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 28px 16px 52px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-topbar h1 {
    margin: 4px 0 0;
    font-size: 28px;
}

.admin-topbar nav {
    display: flex;
    gap: 14px;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 16px;
}

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

.admin-card h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

label {
    display: grid;
    gap: 7px;
    margin-bottom: 12px;
}

label span {
    color: #475467;
    font-size: 13px;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    padding: 12px;
    color: var(--text);
    background: #ffffff;
    outline: 0;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(22, 135, 255, 0.12);
}

.primary-action,
.secondary-action,
.danger-button {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    font-weight: 800;
    cursor: pointer;
}

.primary-action {
    color: white;
    background: linear-gradient(135deg, #1687ff, #4fb0ff);
    box-shadow: 0 12px 22px rgba(22, 135, 255, 0.2);
}

.secondary-action {
    color: #667085;
    background: #ffffff;
    border: 1px solid #d8dee8;
}

.danger-button {
    min-height: 40px;
    color: #ffffff;
    background: var(--danger);
}

.text-link {
    color: var(--blue);
    font-size: 14px;
    font-weight: 800;
}

.text-link.center {
    display: block;
    text-align: center;
    margin-top: 16px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 16px;
}

.section-heading h2 {
    margin: 4px 0 0;
    font-size: 20px;
    line-height: 1.25;
}

.section-heading.compact {
    align-items: center;
}

.two-col,
.three-col {
    display: grid;
    gap: 12px;
}

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

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

.inline-form {
    display: grid;
    grid-template-columns: 1fr 1fr 72px 1.3fr 54px 78px auto auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.inline-form input,
.inline-form label {
    margin-bottom: 0;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475467;
    font-size: 14px;
    font-weight: 700;
}

.check-row input {
    width: auto;
}

.small-button {
    min-height: 42px;
    padding: 0 14px;
}

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

.manager-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.manager-item summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.manager-item summary::-webkit-details-marker {
    display: none;
}

.manager-item summary span {
    display: grid;
    gap: 4px;
}

.manager-item small {
    color: var(--muted);
}

.manager-item em {
    color: var(--green);
    font-style: normal;
    font-size: 13px;
    font-weight: 800;
}

.edit-form,
.delete-form {
    border-top: 1px solid #eef2f7;
    padding: 14px;
}

.delete-form {
    display: flex;
    justify-content: flex-end;
}

.button-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.file-picker {
    border: 1px dashed #d8dee8;
    border-radius: 8px;
    padding: 14px;
    background: var(--paper-soft);
}

.help-text {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

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

.alert.success {
    color: #05603a;
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.alert.error {
    color: #b42318;
    background: #fff1f0;
    border: 1px solid #fecdca;
}

.empty-state {
    border: 1px dashed #d8dee8;
    border-radius: 8px;
    padding: 28px 18px;
    text-align: center;
    background: #fbfcff;
}

.empty-state p {
    margin: 8px 0 0;
    color: var(--muted);
}

.admin-empty {
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .ad-panel,
    .admin-grid,
    .two-col,
    .three-col,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .table-row {
        grid-template-columns: minmax(170px, 1fr) 90px 150px;
    }
}

@media (max-width: 640px) {
    .disk-app {
        padding: 14px 10px 24px;
    }

    .disk-header {
        margin-bottom: 16px;
    }

    .disk-brand small {
        display: none;
    }

    .home-strip,
    .panel-toolbar,
    .admin-topbar,
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-strip {
        padding: 18px;
    }

    .strip-stats {
        width: 100%;
    }

    .ad-panel {
        padding: 18px;
    }

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

    .disk-search {
        width: 100%;
    }

    .table-head {
        display: none;
    }

    .table-row {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 14px;
        gap: 8px;
    }

    .data-row {
        border-top: 1px solid #eef2f7;
    }

    .name-cell small {
        white-space: normal;
    }
}
