:root {
    --paper: #f8f9fa;
    --white: #ffffff;
    --line: #dadce0;
    --line-strong: #c6c9ce;
    --text: #202124;
    --text-dim: #5f6368;
    --text-faint: #80868b;
    --blue: #1a73e8;
    --blue-hover: #174ea6;
    --blue-soft: #e8f0fe;
    --green: #188038;
    --green-soft: #e6f4ea;
    --red: #d93025;
    --red-soft: #fce8e6;
    --shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 2px 6px rgba(60, 64, 67, 0.15);
    --shadow-lg: 0 4px 8px rgba(60, 64, 67, 0.15), 0 12px 28px rgba(60, 64, 67, 0.12);
    --radius: 16px;
    --font: "Roboto", "Noto Sans", Arial, sans-serif;
    --display: "Roboto", "Noto Sans", Arial, sans-serif;
    --mono: "Roboto Mono", ui-monospace, monospace;
    --primary-color: var(--blue);
    --primary-hover: var(--blue-hover);
    --secondary-color: var(--text-dim);
    --danger-color: var(--red);
    --success-color: var(--green);
    --bg-primary: var(--white);
    --bg-secondary: var(--paper);
    --bg-tertiary: #eef0f2;
    --text-primary: var(--text);
    --text-secondary: var(--text-dim);
    --text-tertiary: var(--text-faint);
    --border-color: var(--line);
    --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.18);
    --shadow-md: var(--shadow);
    --shadow-xl: var(--shadow-lg);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: var(--radius);
    --transition: 160ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    background: var(--paper);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(900px 420px at 8% -8%, rgba(26, 115, 232, 0.08), transparent 55%),
        radial-gradient(700px 380px at 100% 0%, rgba(24, 128, 56, 0.05), transparent 50%),
        #f8f9fa;
}

.orb,
.grain {
    display: none;
}

.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-content {
    max-width: 1120px;
    margin: 0 auto;
}

.header-wrapper {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.header-left {
    display: flex;
    justify-content: flex-start;
}

.header-center {
    cursor: pointer;
    user-select: none;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 0.78rem;
    background: var(--white);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(24, 128, 56, 0.14);
    animation: pulse 1.8s ease-in-out infinite;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.logo-bg {
    fill: var(--blue);
}

.logo-path {
    stroke: #ffffff;
}

.logo-copy {
    text-align: left;
}

.logo-text {
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text);
}

.tagline {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-faint);
    letter-spacing: 0.02em;
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 2.2rem 1.25rem 3rem;
}

.hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

.eyebrow {
    color: var(--blue);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 0.55rem;
}

.hero-title {
    font-family: var(--display);
    font-size: clamp(1.65rem, 3.6vw, 2.35rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.25;
    max-width: 18ch;
    margin: 0 auto;
    color: var(--text);
}

.drop-zone {
    position: relative;
    min-height: 320px;
    padding: 2.75rem 1.5rem;
    border-radius: 18px;
    background: var(--white);
    border: 2px dashed #c4c7c5;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.drop-zone-glow {
    display: none;
}

.drop-zone:hover {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.drop-zone.drag-over {
    border-style: solid;
    border-color: var(--blue);
    background: var(--blue-soft);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}

.drop-zone-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
    text-align: center;
}

.drop-zone-icon {
    color: var(--blue);
}

.drop-zone-text {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text);
}

.drop-zone-subtitle {
    color: var(--text-dim);
    font-size: 0.92rem;
    max-width: 40ch;
}

.drop-zone-divider {
    width: min(280px, 80%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-faint);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.drop-zone-divider::before,
.drop-zone-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.drop-zone-buttons {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.45rem;
}

.drop-zone-state {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
    z-index: 2;
}

.drop-zone.uploading .drop-zone-state {
    opacity: 1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e8eaed;
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.feature-row {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin: 1.3rem 0 0;
}

.feature-row li {
    padding: 1rem 1.05rem;
    border-radius: 12px;
    background: var(--white);
    border: 1px solid var(--line);
}

.feature-row strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
}

.feature-row span {
    color: var(--text-dim);
    font-size: 0.84rem;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 24px;
    padding: 0.7rem 1.35rem;
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    letter-spacing: 0.01em;
    transition: background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.btn:hover:not(:disabled) {
    box-shadow: var(--shadow-sm);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--blue-hover);
}

.btn-secondary {
    background: var(--white);
    color: var(--blue);
    border: 1px solid var(--line);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--blue-soft);
    border-color: #a8c7fa;
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #b3261e;
}

.btn-success {
    background: var(--green);
    color: #fff;
}

.btn-success:hover:not(:disabled) {
    background: #137333;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
}

.transfer-panel {
    margin-top: 1.4rem;
    padding: 1.35rem;
    border-radius: 16px;
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.progress-section {
    margin-bottom: 1.3rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.6rem;
}

.progress-title {
    font-weight: 500;
}

.progress-percent {
    font-family: var(--mono);
    color: var(--blue);
    font-size: 1.05rem;
}

.progress-bar-container {
    height: 8px;
    border-radius: 999px;
    background: #e8eaed;
    overflow: hidden;
    margin-bottom: 0.85rem;
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--blue);
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    gap: 1.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.stat-label,
.expire-label,
.stat-name {
    color: var(--text-faint);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 500;
}

.stat-value,
.stat-val,
.expire-time {
    font-family: var(--mono);
    font-weight: 500;
}

.contents-section {
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 500;
}

.expiration-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--green-soft);
    border: 1px solid #ceead6;
}

.expire-time {
    color: var(--green);
}

.items-tree {
    max-height: 380px;
    overflow: auto;
    padding: 0.35rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fbfcfd;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    margin-bottom: 0.3rem;
    background: var(--white);
}

.tree-item:hover {
    background: var(--blue-soft);
}

.tree-item-icon {
    font-size: 1.15rem;
}

.tree-item-info {
    flex: 1;
    min-width: 0;
}

.tree-item-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-item-meta {
    font-size: 0.75rem;
    color: var(--text-faint);
}

.tree-item-actions {
    display: flex;
    gap: 0.35rem;
}

.tree-item-btn {
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--blue);
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    font-size: 0.74rem;
    font-family: var(--font);
    font-weight: 500;
    cursor: pointer;
}

.tree-item-btn:hover {
    background: var(--blue-soft);
    border-color: #a8c7fa;
}

.tree-item-btn.danger {
    color: var(--red);
}

.tree-item-btn.danger:hover {
    color: #fff;
    background: var(--red);
    border-color: var(--red);
}

.tree-level-2 { margin-left: 1.2rem; }
.tree-level-3 { margin-left: 2.2rem; }

.transfer-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.stat-row {
    padding: 0.8rem 0.95rem;
    border-radius: 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transfer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.empty-state {
    margin-top: 1.5rem;
    text-align: center;
    padding: 1.2rem 1rem 0.2rem;
    color: var(--text-dim);
}

.empty-icon {
    color: var(--blue);
    margin-bottom: 0.55rem;
}

.empty-title {
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.empty-text {
    max-width: 44ch;
    margin: 0 auto;
    color: var(--text-dim);
}

.footer {
    margin-top: auto;
    padding: 1.1rem;
    text-align: center;
    color: var(--text-faint);
    border-top: 1px solid var(--line);
    background: var(--white);
    font-size: 0.82rem;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.18s ease;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(32, 33, 36, 0.45);
}

.modal-container {
    position: relative;
    z-index: 2;
    width: min(440px, 92vw);
    padding: 1.6rem;
    border-radius: 16px;
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: slideUp 0.22s ease;
}

.modal-icon {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}

.modal-title,
.pin-title {
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.modal-message,
.pin-subtitle {
    color: var(--text-dim);
    margin-bottom: 1.2rem;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.pin-container {
    min-width: min(320px, 92vw);
}

.pin-header {
    margin-bottom: 1.1rem;
}

.pin-input-container {
    position: relative;
    margin-bottom: 0.9rem;
    text-align: left;
}

.pin-input,
.pin-display-box {
    width: 100%;
    padding: 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--text);
    font-family: var(--mono);
    font-size: 1.15rem;
    letter-spacing: 0.28em;
    text-align: center;
}

.pin-input:focus {
    outline: none;
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.18);
}

.pin-display {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: var(--text-faint);
    letter-spacing: 0.28em;
    font-family: var(--mono);
}

.pin-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 500;
}

.pin-message {
    min-height: 1.2rem;
    color: var(--red);
    font-size: 0.88rem;
    margin-bottom: 0.7rem;
}

.pin-hint {
    margin-top: 0.95rem;
    color: var(--text-faint);
    font-size: 0.82rem;
}

#pinExpireCountdown {
    color: var(--blue);
    font-family: var(--mono);
}

.modal.notification.success .modal-icon,
.modal.notification.success .modal-title { color: var(--green); }
.modal.notification.error .modal-icon,
.modal.notification.error .modal-title { color: var(--red); }
.modal.notification.info .modal-icon,
.modal.notification.info .modal-title { color: var(--blue); }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@keyframes checkmark {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes shake {
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.modal.notification.success .modal-icon { animation: checkmark 0.4s ease; }
.modal.notification.error .modal-icon { animation: shake 0.35s ease; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 99px;
}

@media (max-width: 800px) {
    .header-wrapper {
        grid-template-columns: 1fr auto;
    }
    .header-left {
        display: none;
    }
    .feature-row {
        grid-template-columns: 1fr;
    }
    .hero-title {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 0.75rem 0.9rem;
    }
    .header-wrapper {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }
    .header-right,
    .header-center,
    .header-left {
        width: 100%;
        justify-content: center;
    }
    .logo {
        justify-content: center;
    }
    #wipeAllBtn {
        width: 100%;
    }
    .drop-zone {
        min-height: 260px;
        padding: 1.8rem 1rem;
    }
    .drop-zone-buttons,
    .transfer-actions,
    .modal-actions {
        flex-direction: column;
    }
    .drop-zone-buttons .btn,
    .transfer-actions .btn,
    .modal-actions .btn {
        width: 100%;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .expiration-badge {
        width: 100%;
        justify-content: space-between;
    }
    .transfer-stats {
        grid-template-columns: 1fr;
    }
    .tree-item {
        flex-wrap: wrap;
    }
    .tree-item-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .tree-level-2 { margin-left: 0.55rem; }
    .tree-level-3 { margin-left: 1rem; }
    .main-content {
        padding: 1.3rem 0.9rem 2rem;
    }
}
