/* 云盘管理系统 - 本地化样式（模块 0：安装向导 + 基础样式） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* 通用组件 */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.btn {
    display: inline-block;
    margin-top: 16px;
    padding: 9px 26px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s;
}
.btn:hover { background: #1d4ed8; }
.muted { color: #888; font-size: 13px; }
.pass { color: #16a34a; }
.fail { color: #dc2626; }
code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.table td { padding: 9px 12px; border-bottom: 1px solid #eee; font-size: 14px; }
.table td:last-child { text-align: right; font-weight: 600; }

/* 表单 */
form label { display: block; margin: 14px 0 5px; font-size: 14px; font-weight: 600; }
form input[type=text],
form input[type=password] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
form input:focus { border-color: #2563eb; }

/* 安装向导 */
.install-wrap { max-width: 620px; margin: 60px auto; padding: 0 16px; }
.install-title { text-align: center; font-size: 26px; margin-bottom: 24px; }
.install-title span { font-size: 15px; color: #2563eb; font-weight: 500; margin-left: 8px; }
.install-wrap h2 { font-size: 18px; margin-bottom: 14px; }

/* 首页占位 */
.home-wrap { max-width: 640px; margin: 100px auto; text-align: center; }
.home-wrap h1 { font-size: 30px; margin-bottom: 16px; }
.ok-badge {
    display: inline-block;
    background: #dcfce7;
    color: #16a34a;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 14px;
    margin-bottom: 10px;
}

/* ===== 登录页 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; }
.login-title { text-align: center; font-size: 22px; margin-bottom: 20px; }
.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    margin-bottom: 6px;
}
.btn-block { width: 100%; margin-top: 20px; padding: 11px; font-size: 15px; }

/* ===== 顶栏 ===== */
.topbar {
    height: 52px;
    background: #1e293b;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-brand { font-size: 16px; font-weight: 600; }
.topbar-user { font-size: 13px; display: flex; align-items: center; gap: 14px; }
.topbar-link { color: #cbd5e1; text-decoration: none; }
.topbar-link:hover { color: #fff; }

/* ===== 云盘布局 ===== */
.disk-layout { display: flex; min-height: calc(100vh - 52px); }
.sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 14px 0;
    flex-shrink: 0;
    overflow-y: auto;
}
.tree-root {
    display: block;
    padding: 8px 18px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.tree-root.active, .tree-root:hover { background: #eff6ff; color: #2563eb; }
.tree { list-style: none; }
.tree li a {
    display: block;
    padding: 6px 18px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tree li.active > a { background: #eff6ff; color: #2563eb; font-weight: 600; }
.tree li a:hover { background: #f8fafc; }
.tree .tree { padding-left: 16px; }

.main { flex: 1; padding: 18px 22px; overflow-x: auto; }

/* 工具栏 */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.breadcrumb { font-size: 14px; }
.breadcrumb a { color: #2563eb; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; color: #999; }
.toolbar-actions { display: flex; gap: 8px; }
.btn-sm { margin-top: 0; padding: 7px 16px; font-size: 13px; }
.btn-gray { background: #6b7280; }
.btn-gray:hover { background: #4b5563; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn:disabled { background: #9ca3af; cursor: not-allowed; }

/* 文件表格 */
.file-table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}
.file-table th {
    text-align: left;
    padding: 11px 14px;
    font-size: 13px;
    color: #666;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
}
.file-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.file-table tr:hover td { background: #f8fafc; }
.col-check { width: 36px; }
.col-size { width: 90px; }
.col-time { width: 170px; }
.col-op { width: 150px; }
.cell-name { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname { color: #333; text-decoration: none; }
a.fname:hover { color: #2563eb; }
.expand-btn {
    display: inline-block;
    width: 18px;
    cursor: pointer;
    color: #2563eb;
    user-select: none;
    text-align: center;
}
.empty-tip { text-align: center; color: #999; padding: 40px 0 !important; }

/* 操作列按钮 */
.col-op a, .link-btn {
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
    margin-right: 10px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.col-op a:hover, .link-btn:hover { text-decoration: underline; }

/* 二级目录展开 */
.children-cell { background: #f8fafc; padding: 8px 14px 8px 44px !important; }
.child-list { display: flex; flex-direction: column; gap: 4px; }
.child-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}
.child-item:hover { background: #eff6ff; }
.child-size { margin-left: auto; font-size: 12px; }

/* ===== 弹窗 ===== */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.modal {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    width: 420px;
    max-width: 92vw;
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal input[type=text] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.modal input[type=text]:focus { border-color: #2563eb; }
.modal-msg { min-height: 20px; font-size: 13px; margin-top: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.share-link-row { display: flex; gap: 8px; margin-top: 10px; }
.share-link-row input { flex: 1; }
.share-link-row .btn { margin-top: 0; }

/* ===== 共享页 ===== */
.share-wrap { max-width: 900px; margin: 40px auto; padding: 0 16px; }
.share-wrap h2 { font-size: 18px; margin-bottom: 12px; }
.share-wrap .breadcrumb { margin-bottom: 12px; }

/* ===== 上传进度 ===== */
.upload-list { max-height: 320px; overflow-y: auto; }
.upload-item { padding: 8px 0; border-bottom: 1px solid #f1f5f9; }
.upload-item:last-child { border-bottom: none; }
.upload-name { font-size: 13px; margin-bottom: 5px; word-break: break-all; }
.progress {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0;
    background: #2563eb;
    border-radius: 999px;
    transition: width .2s;
}
.progress-bar.done { background: #16a34a; }
.progress-bar.fail-bar { background: #dc2626; }
.upload-status { font-size: 12px; margin-top: 4px; }

/* 删除确认 */
.delete-tip { font-size: 14px; line-height: 1.7; word-break: break-all; }

/* ===== 在线预览 ===== */
.preview-mask { background: rgba(0, 0, 0, .72); }
.preview-modal {
    width: 900px;
    max-width: 94vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #eee;
}
.preview-head h3 {
    margin: 0;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80%;
}
.preview-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 2px 8px;
}
.preview-close:hover { color: #111; }
.preview-body {
    flex: 1;
    overflow: auto;
    padding: 16px 20px;
    min-height: 200px;
}
.preview-foot { padding: 12px 20px; border-top: 1px solid #eee; text-align: right; }
.preview-img-wrap { text-align: center; }
.preview-img { max-width: 100%; max-height: 62vh; border-radius: 6px; }
.preview-video { width: 100%; max-height: 62vh; background: #000; border-radius: 6px; }
.preview-audio-wrap { text-align: center; padding: 40px 0; }
.preview-audio-wrap audio { width: 100%; max-width: 480px; }
.preview-text {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 56vh;
    overflow: auto;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
}
.preview-unsupport { text-align: center; padding: 50px 0; }
.preview-unsupport p:first-child { font-size: 15px; margin-bottom: 8px; }

/* ===== 管理后台 ===== */
.admin-main { background: #f0f2f5; }
.page-title { font-size: 20px; margin-bottom: 16px; }
.card-title { font-size: 15px; margin-bottom: 12px; }

.admin-nav {
    display: block;
    padding: 10px 18px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
}
.admin-nav:hover { background: #f8fafc; }
.admin-nav.active { background: #eff6ff; color: #2563eb; font-weight: 600; border-right: 3px solid #2563eb; }

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .05);
}
.stat-num { font-size: 26px; font-weight: 700; color: #2563eb; }
.stat-label { font-size: 13px; color: #888; margin-top: 6px; }

/* 7 天柱状图（纯 CSS） */
.chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 180px;
    padding: 10px 4px 0;
}
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart-bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.chart-bar {
    width: 60%;
    min-height: 2px;
    background: linear-gradient(180deg, #60a5fa, #2563eb);
    border-radius: 4px 4px 0 0;
    transition: height .3s;
}
.chart-num { font-size: 12px; color: #2563eb; font-weight: 600; margin-top: 4px; }
.chart-label { font-size: 12px; color: #999; }

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    background: #f3f4f6;
    color: #555;
}
.tag-admin { background: #dbeafe; color: #2563eb; }

/* 行内表单 */
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-inline input, .form-inline select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.form-inline input:focus, .form-inline select:focus { border-color: #2563eb; }
.form-inline .btn { margin-top: 0; }

.col-op-lg { width: 200px; }

/* 文本编辑 */
.edit-textarea {
    width: 100%;
    min-height: 46vh;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    line-height: 1.6;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    resize: vertical;
    outline: none;
}
.edit-textarea:focus { border-color: #2563eb; }

/* ===== 系统设置 ===== */
.set-label { display: block; margin: 12px 0 5px; font-size: 13px; font-weight: 600; color: #555; }
.set-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}
.set-input:focus { border-color: #2563eb; }
.set-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 20px;
}
.set-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 6px 0 4px; cursor: pointer; }
.set-check input { width: 16px; height: 16px; }
