/* ═══════════════════════════════════════════════════════
   File Share Service - Stylesheet
   Brand: 月光石 · 职业咨询服务
   Primary: #1a365d
   ═══════════════════════════════════════════════════════ */

:root {
    --primary: #1a365d;
    --primary-light: #2c5282;
    --primary-dark: #0f2440;
    --accent: #3182ce;
    --bg: #f7fafc;
    --surface: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --success: #38a169;
    --danger: #e53e3e;
    --warning: #d69e2e;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 14px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* ── Buttons ─────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none !important;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #2b6cb0; }
.btn-danger { background: var(--danger); color: #fff; }

.btn-large { padding: 14px 32px; font-size: 16px; border-radius: 10px; }
.btn-small { padding: 6px 14px; font-size: 13px; }
.btn-tiny { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Brand Header ────────────────────────── */

.brand-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--primary);
}
.brand-logo {
    font-size: 48px;
    line-height: 1;
}
.brand-logo-small { font-size: 28px; }
.brand-text h1 {
    font-size: 24px;
    color: var(--primary);
    font-weight: 700;
}
.brand-url {
    color: var(--text-light);
    font-size: 14px;
}

/* ── Download Page ───────────────────────── */

.download-page { max-width: 720px; }

.file-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.file-icon-large { font-size: 48px; }
.file-name {
    font-size: 18px;
    font-weight: 600;
    word-break: break-all;
}
.file-meta {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 14px;
}

.preview-container {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.preview-container embed,
.preview-container iframe {
    display: block;
    border: none;
    min-height: 500px;
}
.preview-fallback {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    color: var(--text-light);
}
.image-preview {
    text-align: center;
    padding: 16px;
}

.action-area {
    text-align: center;
    margin: 24px 0;
}

.status-bar {
    display: flex;
    gap: 24px;
    justify-content: center;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.status-item { text-align: center; }
.status-label {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 4px;
}
.status-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}
.status-value.expired { color: var(--danger); }

.security-notice {
    text-align: center;
    padding: 16px;
    background: #ebf8ff;
    border-radius: var(--radius);
    border: 1px solid #bee3f8;
    margin-bottom: 24px;
    font-size: 13px;
    color: var(--primary-light);
}
.security-notice p { margin: 4px 0; }

/* ── Expired Page ────────────────────────── */

.expired-page { max-width: 560px; text-align: center; }
.expired-content {
    padding: 48px 24px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.expired-icon { font-size: 64px; margin-bottom: 16px; }
.expired-content h2 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 12px;
}
.expired-reason {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 8px;
}
.expired-hint {
    font-size: 14px;
    color: var(--text-light);
}

/* ── Login Page ──────────────────────────── */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}
.login-card {
    width: 100%;
    max-width: 380px;
    padding: 40px 32px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.login-card .brand-logo { margin-bottom: 16px; }
.login-card h2 {
    color: var(--primary);
    margin-bottom: 8px;
}
.login-subtitle {
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: var(--surface);
}
.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(49,130,206,0.1);
}
.form-row {
    display: flex;
    gap: 12px;
}
.form-row .form-group { flex: 1; }

.alert { padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fed7d7; color: #c53030; }

/* ── Files Page ──────────────────────────── */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 16px;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-left h1, .topbar-left h2 {
    font-size: 20px;
    color: var(--primary);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.breadcrumb .sep { color: var(--text-light); }

.file-list {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.file-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: #f1f5f9; }
.file-row-dir { font-weight: 500; }

.file-link {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    color: var(--text);
}
.file-link:hover { color: var(--accent); text-decoration: none; }

.file-row .file-icon { font-size: 20px; flex-shrink: 0; }
.file-row .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-row .file-size {
    width: 80px;
    text-align: right;
    font-size: 13px;
    color: var(--text-light);
    flex-shrink: 0;
}
.file-row .file-date {
    width: 130px;
    text-align: right;
    font-size: 13px;
    color: var(--text-light);
    flex-shrink: 0;
}
.file-row .file-actions {
    width: 80px;
    text-align: right;
    flex-shrink: 0;
}
.file-row-parent {
    text-decoration: none !important;
    color: var(--text-light);
    display: flex;
}

.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-light);
    font-size: 16px;
}

/* ── Preview Page ────────────────────────── */

.preview-frame {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 16px;
}
.preview-frame embed,
.preview-frame iframe {
    display: block;
    border: none;
    width: 100%;
    min-height: 700px;
}
.no-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}
.no-preview-content { text-align: center; padding: 48px; }
.no-preview-icon { font-size: 64px; margin-bottom: 16px; }

.file-size-badge {
    background: var(--border);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-light);
}

/* ── Modal ────────────────────────────────── */

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 16px;
}
.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; color: var(--primary); }
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}
.modal-body { padding: 20px; }

.share-file-name {
    font-weight: 500;
    margin-bottom: 16px;
    padding: 10px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 14px;
}

.share-result {
    margin-top: 16px;
    padding: 12px;
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    border-radius: 8px;
}
.share-result p { font-size: 14px; margin-bottom: 8px; }
.share-url-box {
    display: flex;
    gap: 8px;
}
.share-url-box input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

/* ── Footer ──────────────────────────────── */

.footer {
    text-align: center;
    padding: 24px 0;
    font-size: 13px;
    color: var(--text-light);
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 640px) {
    .container { padding: 16px 12px; }
    .brand-header { padding: 16px 0; }
    .brand-logo { font-size: 36px; }
    .brand-text h1 { font-size: 20px; }

    .file-card { flex-direction: column; text-align: center; }
    .file-meta { justify-content: center; }

    .status-bar { flex-direction: column; gap: 12px; }

    .file-row .file-size,
    .file-row .file-date { display: none; }
    .file-row .file-actions { width: 60px; }

    .form-row { flex-direction: column; gap: 0; }

    .topbar { flex-direction: column; gap: 8px; align-items: flex-start; }
    .topbar-right { width: 100%; justify-content: flex-end; }

    .preview-frame embed,
    .preview-frame iframe { min-height: 400px; }
    .preview-container embed,
    .preview-container iframe { min-height: 350px; }
}
