/* 星恋桃后台 - 暗色主题 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, "Microsoft YaHei", sans-serif;
    background: #0a0a1a;
    color: #e0e0e0;
    min-height: 100vh;
}

header {
    background: #1b2735;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    gap: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 { font-size: 20px; font-weight: 500; white-space: nowrap; }

header nav { display: flex; gap: 8px; flex-wrap: wrap; }

header nav a {
    color: #aab;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 15px;
    white-space: nowrap;
}

header nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
header nav a.active { background: rgba(255, 204, 0, 0.15); color: #ffcc00; }

main { max-width: 1000px; margin: 0 auto; padding: 40px 32px; }
main h2 { font-size: 24px; margin-bottom: 24px; font-weight: 400; }
main h3 { font-size: 18px; margin: 24px 0 12px; font-weight: 400; color: #aab; }

/* 统计卡片 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 40px; }
.stat-card {
    background: #1b2735;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.2s;
    display: block;
}
.stat-card:hover { border-color: #ffcc00; transform: translateY(-2px); }
.stat-card i { font-size: 28px; color: #ffcc00; margin-bottom: 12px; }
.stat-num { font-size: 36px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.stat-label { font-size: 14px; color: #aab; margin-top: 4px; }

/* 上传框 */
.upload-box {
    background: #1b2735;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.upload-box h3 { margin: 0 0 12px; color: #ffcc00; }

.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }

input[type="text"], input[type="password"], textarea, select {
    background: #0f1720;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
input[type="text"], input[type="password"], select { min-width: 200px; }
input:focus, textarea:focus, select:focus { border-color: #ffcc00; }

.upload-box input[type="file"] {
    background: #0f1720;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    flex: 1;
    min-width: 200px;
}
.upload-box textarea { width: 100%; resize: vertical; margin-bottom: 12px; }

select option { background: #1b2735; color: #fff; }

.hint { font-size: 13px; color: #889; margin-top: 8px; }

/* 按钮 */
.btn-primary {
    background: #ffcc00;
    color: #1a1a1a;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-primary:hover { background: #ffd633; transform: translateY(-1px); color: #1a1a1a; }

.btn-secondary {
    background: #2a9d8f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.btn-secondary:hover { background: #2fbbab; transform: translateY(-1px); color: #fff; }

.btn-danger {
    background: transparent;
    border: 1px solid rgba(255, 100, 100, 0.4);
    color: #ff8888;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    font-family: inherit;
    text-decoration: none;
}
.btn-danger:hover { background: rgba(255, 100, 100, 0.15); border-color: #ff8888; color: #ff8888; }

.mini-btn {
    background: #262a44;
    color: #dfe3f2;
    border: 1px solid #3a3f5c;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}
.mini-btn:hover { background: #3a3f5c; }
.mini-btn.danger { color: #ff7b7b; }

/* 文件列表 */
.file-list { list-style: none; background: #1b2735; border-radius: 12px; padding: 8px; margin-bottom: 24px; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; transition: background 0.2s; }
.file-list li:hover { background: rgba(255, 255, 255, 0.04); }
.file-list li i { color: #ffcc00; width: 20px; text-align: center; }
.filename { flex: 1; font-size: 14px; color: #cce; word-break: break-all; }

/* 输出 */
.output {
    background: #0f1720;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    font-family: monospace;
    font-size: 13px;
    color: #aac;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
    min-height: 40px;
}
.output:empty { display: none; }

/* 错误提示框 */
.error-box {
    background: rgba(255, 100, 100, 0.12);
    border: 1px solid rgba(255, 100, 100, 0.4);
    color: #ff9a9a;
    padding: 12px 14px;
    border-radius: 8px;
    margin: 12px 0;
    word-break: break-all;
}

/* ===== 文章分区编辑器 ===== */
.sec-card { background: #1b1e2e; border: 1px solid #2c3048; border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.sec-head { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.sec-head input { flex: 1; font-size: 16px; font-weight: 600; }
.board-card { background: #15182a; border: 1px solid #262a44; border-radius: 10px; padding: 12px; margin: 8px 0 8px 20px; }
.board-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.board-head input { flex: 1; }
.art-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.art-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #2c3048; color: #dfe3f2;
    padding: 4px 10px; border-radius: 20px; font-size: 13px;
}
.art-chip .rm { cursor: pointer; color: #ff7b7b; font-weight: 700; }
.art-add { display: flex; gap: 8px; align-items: center; }
.art-add select { flex: 1; }
.empty { color: #6b7089; font-size: 14px; padding: 8px 0; }
.divider { border: none; border-top: 1px solid #2c3048; margin: 28px 0; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }

/* ===== 照片墙 ===== */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.photo-card { position: relative; border-radius: 8px; overflow: hidden; background: #0f1720; aspect-ratio: 1 / 1; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.photo-card:hover img { transform: scale(1.05); }
.photo-name {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 6px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    font-size: 11px; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-card .btn-danger {
    position: absolute; top: 6px; right: 6px;
    padding: 4px 8px; background: rgba(0, 0, 0, 0.6); border-radius: 6px; opacity: 0; transition: opacity 0.2s;
}
.photo-card:hover .btn-danger { opacity: 1; }

/* 首页照片墙选择 */
.photo-select-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.photo-select-card {
    position: relative; border-radius: 8px; overflow: hidden; background: #0f1720;
    aspect-ratio: 1 / 1; cursor: pointer; border: 3px solid transparent; transition: all 0.2s;
}
.photo-select-card.selected { border-color: #ffcc00; box-shadow: 0 0 12px rgba(255, 204, 0, 0.5); }
.photo-select-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-select-card .check {
    position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.6); border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex; align-items: center; justify-content: center; color: transparent; font-size: 13px; transition: all 0.2s;
}
.photo-select-card.selected .check { background: #ffcc00; border-color: #ffcc00; color: #1a1a1a; }
.photo-select-card .order {
    position: absolute; top: 8px; right: 8px; padding: 2px 8px; border-radius: 6px;
    background: #ffcc00; color: #1a1a1a; font-size: 12px; font-weight: bold;
}
.photo-select-card .pname {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    font-size: 11px; color: #eee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.selected-info { background: #1b2735; border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; font-size: 14px; color: #aac; }
.selected-info strong { color: #ffcc00; }

/* ===== 网盘管理 ===== */
.pan-toolbar { align-items: center; }
.pan-breadcrumb {
    display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
    background: #0f1720; border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; font-size: 14px;
}
.pan-crumb { background: transparent; border: none; color: #ffcc00; cursor: pointer; font-size: 14px; font-family: inherit; padding: 2px 4px; border-radius: 4px; }
.pan-crumb:hover { background: rgba(255, 204, 0, 0.12); }
.pan-sep { color: #667; }
.pan-cur { color: #e0e0e0; }
.pan-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 12px; }
.mkrow { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.mkrow input[type="text"] { flex: 1; min-width: 200px; }

.pan-card {
    position: relative;
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
    background: #0f1720; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px;
    padding: 20px 14px; transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.pan-card:hover { border-color: rgba(255, 204, 0, 0.4); background: rgba(255, 204, 0, 0.04); transform: translateY(-2px); }
.pan-card-icon i { font-size: 34px; color: #ffcc00; line-height: 1; }
.pan-card-file .pan-card-icon i { color: #7fc8ff; }
.pan-card-name { width: 100%; font-size: 14px; color: #cce; word-break: break-all; line-height: 1.4; }
.pan-card-meta { font-size: 12px; color: #889; word-break: break-all; }
.pan-card-hidden { opacity: 0.62; border-style: dashed; }
.pan-card-hidden .pan-card-icon i { color: #778; }
.pan-hidden-badge {
    display: inline-block; margin-top: 2px; padding: 2px 9px; font-size: 11px; line-height: 1.5;
    color: #1a1a1a; background: #ffcc00; border-radius: 999px; font-weight: 600;
}
.pan-check { position: absolute; top: 10px; left: 10px; width: 16px; height: 16px; cursor: pointer; accent-color: #ffcc00; }
.pan-more {
    position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: none; border-radius: 6px;
    background: transparent; color: #889; font-size: 16px; cursor: pointer; line-height: 1;
    transition: color 0.2s, background 0.2s;
}
.pan-more:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.pan-summary { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: #aab; margin-bottom: 12px; }
.pan-summary span { display: inline-flex; align-items: center; gap: 6px; }
.pan-summary i { color: #ffcc00; }
.pan-rename-input { width: 100%; background: #0f1720; border: 1px solid #ffcc00; border-radius: 6px; padding: 6px 8px; color: #fff; font-size: 14px; font-family: inherit; outline: none; }
.pan-drop-hint { display: inline-flex; align-items: center; gap: 6px; color: #889; font-size: 13px; margin-bottom: 8px; }
.pan-drop-hint i { color: #ffcc00; }
.pan-list.pan-dragover { outline: 2px dashed #ffcc00; outline-offset: 4px; border-radius: 12px; background: rgba(255, 204, 0, 0.04); }

.ctx-menu {
    position: fixed; z-index: 999; min-width: 150px;
    background: #16202c; border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); padding: 6px;
}
.ctx-item {
    display: block; width: 100%; background: transparent; border: none; border-radius: 6px;
    color: #dce; padding: 8px 12px; font-size: 13px; font-family: inherit; text-align: left; cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.ctx-item:hover { background: rgba(255, 204, 0, 0.1); color: #ffcc00; }
.ctx-item.ctx-danger { color: #ff7a7a; }
.ctx-item.ctx-danger:hover { background: rgba(255, 90, 90, 0.12); color: #ff9a9a; }

.modal-mask {
    position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.6);
}
.modal-box {
    width: 92%; max-width: 420px; background: #16202c; border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px; padding: 20px 22px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.modal-box h3 { margin: 0 0 14px; color: #fff; font-size: 16px; }
.modal-box select { width: 100%; margin-bottom: 14px; }

.progress-box { background: #0f1720; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.progress-label { font-size: 13px; color: #aab; margin-bottom: 8px; }
.progress-bar { height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: #ffcc00; border-radius: 4px; transition: width 0.2s; }

.batch-bar {
    position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #16202c; border: 1px solid rgba(255, 204, 0, 0.4); border-radius: 10px; padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); margin-bottom: 12px;
}
.batch-bar .btn-secondary, .batch-bar .btn-danger { padding: 6px 14px; font-size: 13px; }

.picker-empty { color: #889; font-size: 13px; padding: 10px 4px; }

/* ===== 全站文件编辑器 ===== */
.pathbar {
    background: #0f1720; border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
}
.pathbar .crumb { color: #ffcc00; text-decoration: none; padding: 2px 4px; border-radius: 4px; }
.pathbar .crumb:hover { background: rgba(255, 204, 0, 0.12); }
.pathbar .sep { color: #667; }
.pathbar .cur { color: #e0e0e0; }

.file-table { width: 100%; border-collapse: collapse; background: #1b2735; border-radius: 12px; overflow: hidden; }
.file-table th, .file-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.file-table th { color: #889; font-weight: 500; font-size: 13px; }
.file-table td { font-size: 14px; }
.file-table tr:last-child td { border-bottom: 0; }
.file-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.file-row-dir td { color: #ffcc00; }
.file-row-dir a { color: #ffcc00; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.file-row-dir a:hover { text-decoration: underline; }
.file-row-file td .fname { color: #cce; word-break: break-all; }
.file-size { color: #889; font-size: 12px; }
.file-mtime { color: #889; font-size: 12px; }
a.file-edit { color: #7fc8ff; text-decoration: none; }
a.file-edit:hover { text-decoration: underline; }
.file-not-editable { color: #667; font-size: 12px; }

.code-editor {
    width: 100%; min-height: 480px; resize: vertical;
    background: #0f1720; border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px; padding: 14px; color: #e0e0e0;
    font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 13px; line-height: 1.5;
    white-space: pre; overflow: auto;
}
.file-meta { color: #889; font-size: 13px; margin: 8px 0 16px; }
.file-warn {
    background: rgba(255, 204, 0, 0.08); border: 1px solid rgba(255, 204, 0, 0.35);
    color: #ffd633; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13px;
}
.file-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }

/* 手机 */
@media (max-width: 640px) {
    header { padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
    main { padding: 24px 16px; }
    .stats { grid-template-columns: 1fr 1fr; }
}
