:root {
    --drive-paper: #f7f8fa;
    --drive-surface: #ffffff;
    --drive-ink: #1d1d1f;
    --drive-muted: #6b7078;
    --drive-line: #e5e7eb;
    --drive-blue: #007aff;
    --drive-blue-soft: #eaf3ff;
    --drive-danger: #d92d20;
}

.law100-drive-page {
    background: var(--drive-paper);
}

.law100-drive-page .site-content {
    padding-top: 0;
}

.drive-shell {
    width: min(1180px, calc(100% - 48px));
    min-height: calc(100vh - 150px);
    margin: 0 auto;
    padding: clamp(52px, 7vw, 92px) 0 110px;
    color: var(--drive-ink);
    font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

.drive-heading {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(420px, 1.25fr);
    gap: clamp(54px, 9vw, 132px);
    align-items: end;
    padding-bottom: clamp(48px, 7vw, 82px);
}

.drive-eyebrow {
    margin: 0;
    color: var(--drive-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.69rem;
    font-weight: 600;
    letter-spacing: 0.15em;
}

.drive-heading h1 {
    margin: 14px 0 0;
    font-size: clamp(4.4rem, 9vw, 8.2rem);
    font-weight: 430;
    letter-spacing: -0.07em;
    line-height: 0.86;
}

.drive-subtitle {
    margin: 24px 0 0;
    color: var(--drive-muted);
    font-size: 1rem;
    letter-spacing: 0.08em;
}

.drive-capacity {
    padding-bottom: 6px;
}

.drive-capacity-copy {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 19px;
    color: var(--drive-muted);
    font-size: 0.8rem;
}

.drive-capacity-copy strong {
    color: var(--drive-ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86rem;
    font-weight: 600;
}

.drive-track {
    position: relative;
    height: 3px;
    overflow: hidden;
    background: #dfe2e7;
}

.drive-track-used,
.drive-track-reserved {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.drive-track-used {
    z-index: 2;
    background: var(--drive-blue);
}

.drive-track-reserved {
    z-index: 1;
    background: #9dc9ff;
}

.drive-capacity-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 24px;
    margin-top: 15px;
    color: var(--drive-muted);
    font-size: 0.72rem;
}

.drive-capacity-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.drive-capacity-legend b {
    color: #484c54;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 500;
}

.drive-capacity-legend i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.drive-capacity-legend .is-used { background: var(--drive-blue); }
.drive-capacity-legend .is-reserved { background: #9dc9ff; }

.drive-workspace {
    overflow: hidden;
    border: 1px solid var(--drive-line);
    border-radius: 22px;
    background: var(--drive-surface);
}

/* More specific than the shared independent shell, which loads after this file. */
.drive-independent .drive-storage-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding: 3px 2px 8px;
    scrollbar-width: thin;
}

.drive-independent .drive-storage-tabs[hidden] { display: none; }
.drive-independent .drive-storage-tabs button,
.drive-independent .drive-storage-settings {
    flex: 0 0 auto;
    white-space: nowrap;
}
.drive-independent .drive-storage-tabs button .drive-icon { width: 18px; height: 18px; color: inherit; }
.drive-independent .drive-storage-tabs button .drive-storage-name { font: inherit; color: inherit; }
.drive-independent .drive-storage-tabs button.is-unready .drive-storage-status { color: #94703b; }
.drive-independent .drive-storage-tabs .drive-storage-settings { margin-left: auto; }
.drive-button[aria-disabled="true"],
.drive-button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 600px) {
    .drive-independent .drive-storage-tabs { gap: 4px; }
    .drive-independent .drive-storage-tabs button { padding: 10px 12px; }
}

.drive-toolbar,
.drive-viewbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.drive-toolbar {
    min-height: 82px;
    padding: 17px 22px 17px 28px;
    border-bottom: 1px solid var(--drive-line);
}

.drive-toolbar-actions {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

.drive-button,
.drive-text-action,
.drive-icon-button,
.drive-name-button,
.drive-breadcrumbs button,
.drive-row-action {
    appearance: none;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.drive-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid var(--drive-line);
    border-radius: 12px;
    background: var(--drive-surface);
    color: #35383e;
    font-size: 0.84rem;
    font-weight: 560;
    line-height: 1;
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}

.drive-button:hover {
    border-color: #cfd3d9;
    background: #fafbfc;
    color: var(--drive-ink);
}

.drive-button:active { transform: scale(0.98); }

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

.drive-button--primary:hover {
    border-color: #006ee6;
    background: #006ee6;
    color: #fff;
}

.drive-button--danger {
    border-color: var(--drive-danger);
    background: var(--drive-danger);
    color: #fff;
}

.drive-button--danger:hover { color: #fff; background: #bd261c; }

.drive-icon {
    display: inline-block;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: var(--drive-icon-url) center / contain no-repeat;
    mask: var(--drive-icon-url) center / contain no-repeat;
}

.drive-breadcrumbs {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    overflow: hidden;
}

.drive-breadcrumbs button {
    flex: 0 1 auto;
    min-width: 0;
    padding: 7px 5px;
    overflow: hidden;
    background: transparent;
    color: var(--drive-muted);
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-breadcrumbs button:last-of-type {
    color: var(--drive-ink);
    font-weight: 560;
}

.drive-breadcrumbs .drive-icon {
    width: 14px;
    height: 14px;
    color: #a0a4ab;
}

.drive-viewbar {
    min-height: 50px;
    padding: 0 25px 0 29px;
    background: #fbfbfc;
    color: var(--drive-muted);
    font-size: 0.74rem;
}

.drive-viewbar p { margin: 0; }

.drive-viewbar select {
    appearance: none;
    padding: 7px 25px 7px 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #555a62;
    font: inherit;
}

.drive-viewbar label { position: relative; }
.drive-viewbar label::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 9px;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid var(--drive-muted);
    border-bottom: 1.5px solid var(--drive-muted);
    transform: translateY(-70%) rotate(45deg);
    pointer-events: none;
}

.drive-dropzone { position: relative; min-height: 330px; }

.drive-dropzone.is-dragging::after {
    content: '';
    position: absolute;
    z-index: 8;
    inset: 10px;
    border: 1px dashed var(--drive-blue);
    border-radius: 16px;
    background: rgba(234, 243, 255, 0.94);
    pointer-events: none;
}

.drive-drop-message {
    position: absolute;
    z-index: 9;
    inset: 0;
    display: flex;
    visibility: hidden;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: var(--drive-blue);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
}

.drive-dropzone.is-dragging .drive-drop-message { visibility: visible; opacity: 1; }
.drive-drop-message .drive-icon { width: 28px; height: 28px; }

.drive-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.drive-table th,
.drive-table td {
    padding: 0 18px;
    border-bottom: 1px solid #eceef1;
    text-align: left;
}

.drive-table th {
    height: 44px;
    color: #8a8e95;
    font-size: 0.69rem;
    font-weight: 500;
}

.drive-table th:first-child,
.drive-table td:first-child { width: 55%; padding-left: 28px; }
.drive-table th:nth-child(2), .drive-table td:nth-child(2) { width: 13%; }
.drive-table th:nth-child(3), .drive-table td:nth-child(3) { width: 20%; }
.drive-table th:last-child, .drive-table td:last-child { width: 12%; padding-right: 24px; }
.drive-table tbody tr:last-child td { border-bottom: 0; }

.drive-table tbody tr {
    height: 68px;
    transition: background 0.16s ease;
}

.drive-table tbody tr:hover { background: #fafbfc; }

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

.drive-file-icon {
    width: 22px;
    height: 22px;
    color: #61666f;
}

.drive-file-icon.is-folder { color: var(--drive-blue); }

.drive-name-button {
    min-width: 0;
    overflow: hidden;
    padding: 10px 0;
    background: transparent;
    color: #2b2e33;
    font-size: 0.87rem;
    font-weight: 520;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drive-name-button:hover { color: var(--drive-blue); }
.drive-cell-muted { color: #7c8189; font-size: 0.75rem; }

.drive-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.drive-table tr:hover .drive-row-actions,
.drive-table tr:focus-within .drive-row-actions { opacity: 1; }

.drive-row-action,
.drive-icon-button {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: transparent;
    color: #747982;
}

.drive-row-action:hover,
.drive-icon-button:hover { background: #eef0f3; color: var(--drive-ink); }
.drive-row-action.is-danger:hover { color: var(--drive-danger); background: #fff1f0; }
.drive-row-action .drive-icon, .drive-icon-button .drive-icon { width: 18px; height: 18px; }

.drive-empty {
    display: grid;
    min-height: 330px;
    place-content: center;
    justify-items: center;
    padding: 54px 24px;
    text-align: center;
}

.drive-empty[hidden] { display: none; }
.drive-empty-icon { width: 38px; height: 38px; color: #a9afb8; }
.drive-empty h2 { margin: 21px 0 0; font-size: 1.15rem; font-weight: 560; }
.drive-empty p { margin: 10px 0 0; color: var(--drive-muted); font-size: 0.84rem; }
.drive-empty > div { display: flex; gap: 20px; margin-top: 24px; }

.drive-text-action {
    padding: 4px 0;
    background: transparent;
    color: var(--drive-blue);
    font-size: 0.82rem;
    font-weight: 560;
}

.drive-uploads {
    position: fixed;
    z-index: 1200;
    right: 26px;
    bottom: 26px;
    width: min(390px, calc(100vw - 32px));
    max-height: min(520px, calc(100vh - 52px));
    overflow: hidden;
    border: 1px solid var(--drive-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.drive-uploads[hidden] { display: none; }

.drive-uploads > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 17px 15px 20px;
    border-bottom: 1px solid var(--drive-line);
}

.drive-uploads h2 { margin: 5px 0 0; font-size: 1rem; font-weight: 580; }
.drive-upload-list { max-height: 390px; overflow: auto; }

.drive-upload-item {
    padding: 17px 20px;
    border-bottom: 1px solid #eceef1;
}

.drive-upload-item:last-child { border-bottom: 0; }
.drive-upload-top { display: flex; align-items: center; gap: 11px; }
.drive-upload-top > .drive-icon { width: 19px; height: 19px; color: #676c74; }
.drive-upload-name { min-width: 0; flex: 1; overflow: hidden; font-size: 0.82rem; font-weight: 540; text-overflow: ellipsis; white-space: nowrap; }
.drive-upload-actions { display: flex; gap: 2px; }
.drive-upload-actions .drive-icon-button { width: 30px; height: 30px; }
.drive-upload-actions .drive-icon { width: 15px; height: 15px; }
.drive-upload-meta { display: flex; justify-content: space-between; gap: 12px; margin: 9px 0 10px 30px; color: var(--drive-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.66rem; }
.drive-upload-track { height: 2px; margin-left: 30px; overflow: hidden; background: #e4e7eb; }
.drive-upload-track span { display: block; width: 0; height: 100%; background: var(--drive-blue); transition: width 0.2s linear; }
.drive-upload-item.is-error .drive-upload-track span { background: var(--drive-danger); }
.drive-upload-item.is-complete .drive-upload-track span { background: #21a366; }

.drive-dialog {
    width: min(430px, calc(100% - 32px));
    padding: 0;
    border: 1px solid var(--drive-line);
    border-radius: 18px;
    background: var(--drive-surface);
    color: var(--drive-ink);
    box-shadow: none;
}

.drive-dialog[data-drive-form-dialog],
.drive-action-sheet[data-drive-draggable-dialog] {
    position: fixed;
    inset: 50% auto auto 50%;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: 0;
    transform: translate(
        calc(-50% + var(--drive-dialog-x, 0px)),
        calc(-50% + var(--drive-dialog-y, 0px))
    );
}

.drive-dialog[data-drive-form-dialog].is-dragging,
.drive-action-sheet[data-drive-draggable-dialog].is-dragging {
    will-change: transform;
}

.drive-dialog::backdrop { background: rgba(15, 18, 24, 0.32); backdrop-filter: blur(3px); }
.drive-dialog form { padding: 24px; }
.drive-dialog form > header { display: flex; align-items: center; justify-content: space-between; }
.drive-dialog [data-drive-dialog-handle],
.drive-action-sheet [data-drive-dialog-handle] {
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}
.drive-dialog.is-dragging [data-drive-dialog-handle],
.drive-action-sheet.is-dragging [data-drive-dialog-handle] { cursor: grabbing; }
.drive-dialog h2 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.drive-dialog footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.drive-field { display: grid; gap: 9px; margin-top: 24px; color: #555a62; font-size: 0.78rem; }
.drive-field input {
    width: 100%;
    height: 46px;
    padding: 0 13px;
    border: 1px solid #d8dce2;
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--drive-ink);
    font: inherit;
}
.drive-field input:focus { border-color: var(--drive-blue); box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12); }
.drive-dialog-note { margin: 10px 0 0; color: var(--drive-muted); font-size: 0.72rem; line-height: 1.6; }
.drive-dialog--confirm form, .drive-dialog--conflict form { padding: 28px; text-align: center; }
.drive-dialog--confirm p, .drive-dialog--conflict p { margin: 13px 0 0; color: var(--drive-muted); font-size: 0.84rem; line-height: 1.65; }
.drive-dialog--confirm footer { justify-content: center; }
.drive-confirm-icon { width: 30px; height: 30px; margin-bottom: 18px; color: var(--drive-danger); }
.drive-conflict-actions { display: flex; justify-content: center; gap: 9px; margin-top: 24px; }

.drive-action-sheet {
    width: min(360px, calc(100% - 28px));
    padding: 0;
    border: 1px solid var(--drive-line);
    border-radius: 18px;
    background: var(--drive-surface);
    box-shadow: none;
}

.drive-action-sheet::backdrop { background: rgba(15, 18, 24, 0.32); backdrop-filter: blur(3px); }
.drive-action-sheet:focus { outline: none; }
.drive-action-sheet > div { display: grid; gap: 2px; padding: 12px; }
.drive-action-sheet-header {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 8px 12px;
}
.drive-action-sheet strong { min-width: 0; flex: 1; overflow: hidden; font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.drive-action-sheet > div > button {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--drive-ink);
    font: inherit;
    font-size: 0.86rem;
    text-align: left;
}
.drive-action-sheet > div > button:hover { background: #f2f4f6; }
.drive-action-sheet button.is-danger { color: var(--drive-danger); }
.drive-action-sheet .drive-action-sheet-close {
    display: inline-grid;
    width: 36px;
    min-height: 36px;
    flex: 0 0 36px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--drive-muted);
}
.drive-action-sheet .drive-action-sheet-close:hover { background: #f2f4f6; color: var(--drive-ink); }
.drive-action-sheet .drive-action-cancel { justify-content: center; margin-top: 6px; border-top: 1px solid var(--drive-line); border-radius: 0; color: var(--drive-muted); }

.drive-button:focus-visible,
.drive-row-action:focus-visible,
.drive-icon-button:focus-visible,
.drive-name-button:focus-visible,
.drive-breadcrumbs button:focus-visible,
.drive-text-action:focus-visible,
.drive-action-sheet button:focus-visible,
.drive-viewbar select:focus-visible {
    outline: 2px solid var(--drive-blue);
    outline-offset: 2px;
}

@media (max-width: 800px) {
    .drive-shell { width: min(100% - 32px, 720px); padding-top: 38px; }
    .drive-heading { grid-template-columns: 1fr; gap: 46px; }
    .drive-heading h1 { font-size: clamp(4.4rem, 19vw, 7rem); }
    .drive-toolbar { align-items: flex-start; flex-direction: column; }
    .drive-toolbar-actions { align-self: stretch; }
    .drive-toolbar-actions .drive-button { flex: 1; }
    .drive-table th:first-child, .drive-table td:first-child { width: 56%; }
    .drive-table th:nth-child(2), .drive-table td:nth-child(2) { display: none; }
    .drive-table th:nth-child(3), .drive-table td:nth-child(3) { width: 28%; }
    .drive-table th:last-child, .drive-table td:last-child { width: 16%; }
    .drive-row-actions { opacity: 1; }
    .drive-row-action:not([data-drive-more]) { display: none; }
}

@media (max-width: 560px) {
    .law100-drive-page .site-content { overflow: clip; }
    .law100-drive-page .site-footer { padding-bottom: calc(106px + env(safe-area-inset-bottom)); }
    .drive-shell { width: calc(100% - 24px); padding: 28px 0 calc(118px + env(safe-area-inset-bottom)); }
    .drive-heading { gap: 38px; padding: 10px 8px 48px; }
    .drive-heading h1 { font-size: clamp(4rem, 21vw, 5.5rem); }
    .drive-subtitle { margin-top: 19px; }
    .drive-capacity-copy { font-size: 0.74rem; }
    .drive-capacity-legend { gap: 8px 16px; }
    .drive-workspace { border-radius: 18px; }
    .drive-toolbar { min-height: 62px; padding: 14px 17px; }
    .drive-toolbar-actions {
        position: fixed;
        z-index: 1100;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        left: 12px;
        padding: 8px;
        border: 1px solid rgba(229, 231, 235, 0.9);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }
    .drive-viewbar { padding: 0 16px; }
    .drive-table thead { display: none; }
    .drive-table, .drive-table tbody, .drive-table tr, .drive-table td { display: block; width: 100% !important; }
    .drive-table tbody tr {
        position: relative;
        height: auto;
        min-height: 76px;
        padding: 16px 58px 14px 17px;
        border-bottom: 1px solid #eceef1;
    }
    .drive-table td { padding: 0 !important; border: 0; }
    .drive-table td:nth-child(2) { display: block; margin: 4px 0 0 35px; }
    .drive-table td:nth-child(3) { margin: 2px 0 0 35px; }
    .drive-table td:last-child { position: absolute; top: 20px; right: 13px; }
    .drive-name-cell { gap: 12px; }
    .drive-file-icon { width: 23px; height: 23px; }
    .drive-name-button { padding: 4px 0; font-size: 0.88rem; }
    .drive-row-actions { justify-content: flex-end; }
    .drive-empty { min-height: 360px; padding: 42px 24px 132px; }
    .drive-empty > div { display: none; }
    .drive-uploads { right: 12px; bottom: calc(82px + env(safe-area-inset-bottom)); left: 12px; width: auto; }
    .drive-action-sheet {
        position: fixed;
        inset: auto 12px calc(12px + env(safe-area-inset-bottom)) 12px;
        width: auto;
        max-width: none;
        margin: 0;
    }
    .drive-dialog[data-drive-form-dialog],
    .drive-action-sheet[data-drive-draggable-dialog] {
        inset: 50% auto auto 50%;
        transform: translate(-50%, -50%);
    }
    .drive-action-sheet[data-drive-draggable-dialog] {
        width: min(360px, calc(100% - 28px));
        max-width: 360px;
    }
    .drive-dialog [data-drive-dialog-handle],
    .drive-action-sheet [data-drive-dialog-handle] { cursor: default; }
    .drive-dialog form { padding: 22px 20px; }
    .drive-conflict-actions { flex-direction: column-reverse; }
    .drive-conflict-actions .drive-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .drive-track-used,
    .drive-track-reserved,
    .drive-drop-message,
    .drive-button,
    .drive-table tbody tr,
    .drive-row-actions,
    .drive-upload-track span { transition: none !important; }
}
