* {
    box-sizing: border-box;
}

:root {
    --bg: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #d8e1ec;
    --brand: #0f766e;
    --brand-dark: #075985;
    --danger: #dc2626;
    --shadow: 0 18px 55px rgba(15, 23, 42, 0.10);
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 82% 0%, rgba(15, 118, 110, 0.13), transparent 28%),
        linear-gradient(180deg, #f7fafc 0%, var(--bg) 100%);
    font-family: Arial, "Microsoft YaHei", sans-serif;
}

header {
    width: min(1480px, calc(100% - 48px));
    min-height: 78px;
    margin: 22px auto 0;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    color: #ffffff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #ffffff;
    text-decoration: none;
    font-size: 0;
    font-weight: 800;
}

.brand::before {
    content: "PS";
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #0f172a;
    background: linear-gradient(135deg, #99f6e4, #93c5fd 58%, #fde68a);
    font-size: 13px;
    font-weight: 900;
}

.brand::after {
    content: "Package Share";
    font-size: 20px;
    letter-spacing: 0;
}

.topline,
header::after {
    content: "Secure file delivery";
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    font-weight: 700;
}

main {
    width: min(1480px, calc(100% - 48px));
    margin: 28px auto 68px;
}

.panel,
.table-wrap,
.login-box,
.download-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.panel {
    padding: 26px 30px;
    margin-bottom: 22px;
}

.upload-panel,
.section-head,
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.panel h2,
.table-wrap::before {
    margin: 0;
    color: var(--ink);
    font-size: 24px;
    font-weight: 900;
}

.panel p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.upload,
.share-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

input,
select {
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 13px;
    color: var(--ink);
    background: #ffffff;
    outline: none;
    font-size: 14px;
}

input:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.upload input[type="file"] {
    width: min(520px, 46vw);
    padding: 9px 12px;
    background: var(--surface-soft);
}

button,
.secondary {
    min-height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--brand);
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(15, 118, 110, 0.18);
}

button:hover,
.secondary:hover {
    filter: brightness(0.96);
}

.secondary {
    border-color: #cbd5e1;
    color: #334155;
    background: #ffffff;
    box-shadow: none;
}

.danger {
    border-color: var(--danger);
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.18);
}

.table-panel {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.table-panel .section-head {
    padding: 26px 30px;
    margin-bottom: 0;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: #ffffff;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 0 0 8px 8px;
}

.table-wrap::before,
.table-wrap::after {
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1080px;
}

th,
td {
    padding: 20px 30px;
    border-bottom: 1px solid #e8edf4;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #475569;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 900;
}

td:first-child {
    max-width: 540px;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.5;
    word-break: break-word;
}

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

tbody tr:hover {
    background: #fbfdff;
}

.file-cell {
    display: flex;
    gap: 13px;
    align-items: center;
}

.file-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--brand);
    background: #ccfbf1;
    font-size: 11px;
    font-weight: 900;
}

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

.segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.segmented label {
    position: relative;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    min-width: 54px;
    height: 34px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #475569;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.segmented input:checked + span {
    color: #ffffff;
    background: var(--brand);
}

.password-input {
    width: 132px;
}

.alert {
    margin: 0 0 22px;
    padding: 16px 18px;
    border: 1px solid #99f6e4;
    border-radius: 8px;
    color: #134e4a;
    background: #ccfbf1;
    font-weight: 700;
}

.alert a {
    color: #075985;
    font-weight: 900;
}

.alert.error {
    border-color: #fecaca;
    color: #7f1d1d;
    background: #fee2e2;
}

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

body.compact-layout main {
    min-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
}

.auth-shell {
    width: 100%;
    display: grid;
    place-items: center;
}

.login-box,
.download-box {
    width: min(640px, calc(100vw - 48px));
    padding: 52px 56px;
    color: #ffffff;
    background: linear-gradient(135deg, #0f172a, #164e63);
}

.login-box h1,
.download-box h1 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 38px;
    letter-spacing: 0;
}

.login-box p,
.download-box p {
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.7;
}

.login-box form,
.download-box form {
    display: grid;
    gap: 16px;
    margin-top: 32px;
}

.login-box label {
    color: #dbeafe;
    font-weight: 800;
}

body.compact-layout input {
    min-height: 52px;
    font-size: 16px;
}

body.compact-layout button {
    min-height: 54px;
    font-size: 16px;
}

.hero {
    display: none !important;
}

@media (max-width: 900px) {
    header,
    main {
        width: calc(100% - 22px);
    }

    header {
        padding: 18px;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .upload-panel,
    .section-head,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .upload input[type="file"],
    .share-form,
    .share-form input,
    .share-form select,
    .share-form button {
        width: 100%;
    }

    .login-box,
    .download-box {
        width: 100%;
        padding: 34px 24px;
    }

    .login-box h1,
    .download-box h1 {
        font-size: 30px;
    }
}


.upload-progress {
    width: 100%;
    margin-top: 6px;
    padding: 14px 16px;
    border: 1px solid #cde7e3;
    border-radius: 8px;
    background: #f0fdfa;
}

.upload-progress[hidden] {
    display: none !important;
}

.upload-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    color: #134e4a;
    font-size: 14px;
    font-weight: 800;
}

.upload-progress-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #ccfbf1;
}

.upload-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f766e, #2563eb);
    transition: width 0.18s ease;
}

.upload button:disabled,
.upload input:disabled {
    cursor: wait;
    opacity: 0.68;
}


table {
    table-layout: fixed;
}

th:nth-child(1),
td:nth-child(1) {
    width: 38%;
}

th:nth-child(2),
td:nth-child(2) {
    width: 11%;
}

th:nth-child(3),
td:nth-child(3) {
    width: 16%;
}

th:nth-child(4),
td:nth-child(4) {
    width: 27%;
}

th:nth-child(5),
td:nth-child(5) {
    width: 8%;
}

.file-cell {
    min-width: 0;
    max-width: 100%;
}

.file-cell strong {
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.45;
}

.share-form {
    min-width: 0;
}

.share-form input[type="text"] {
    min-width: 0;
}

