/* ============================================
   新音院 - 管理后台 深色主题
   ============================================ */

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

:root {
    --bg-dark: #0f1420;
    --bg-card: #1a1c20;
    --bg-input: #22252b;
    --bg-hover: #2a2e38;
    --text-white: #ffffff;
    --text-gray: #9aa0a9;
    --text-dim: #6c727a;
    --accent: #26e893;
    --red-del: #ef5350;
    --border: rgba(255, 255, 255, 0.06);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    min-height: 100vh;
}

/* ===== 登录页 ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-container { width: 100%; max-width: 380px; }
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 40px 32px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.login-header { text-align: center; margin-bottom: 32px; }
.login-logo { width: 56px; height: 56px; margin: 0 auto 16px; background: var(--accent); color: var(--bg-dark); font-size: 1.6rem; display: flex; align-items: center; justify-content: center; border-radius: 14px; }
.login-header h1 { font-size: 1.2rem; font-weight: 600; letter-spacing: 2px; margin-bottom: 6px; }
.login-header p { font-size: 0.82rem; color: var(--text-dim); }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.78rem; color: var(--text-gray); letter-spacing: 1px; }
.form-group input { background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px; color: var(--text-white); font-size: 0.9rem; font-family: inherit; }
.form-group input:focus { outline: none; border-color: var(--accent); }
.form-group input::placeholder { color: var(--text-dim); }
.btn { border: none; border-radius: var(--radius-sm); padding: 10px 20px; font-size: 0.85rem; cursor: pointer; font-family: inherit; letter-spacing: 1px; }
.btn-primary { background: var(--accent); color: var(--bg-dark); font-weight: 600; }
.btn-primary:hover { background: #2cf0a0; }
.btn-block { width: 100%; padding: 12px; margin-top: 4px; }
.alert { padding: 10px 16px; border-radius: var(--radius-sm); font-size: 0.82rem; margin-bottom: 20px; }
.alert-error { background: rgba(239,83,80,0.12); color: var(--red-del); border: 1px solid rgba(239,83,80,0.2); }
.alert-info { background: rgba(38,232,147,0.08); color: var(--accent); border: 1px solid rgba(38,232,147,0.15); margin-bottom: 20px; }
.login-footer { text-align: center; margin-top: 24px; }
.login-footer a { color: var(--text-dim); font-size: 0.8rem; text-decoration: none; }
.login-footer a:hover { color: var(--text-gray); }

/* ===== 后台主页 ===== */
.top-bar { position: sticky; top: 0; z-index: 100; background: rgba(14,16,20,0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 14px 28px; }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; max-width: 1240px; margin: 0 auto; }
.top-bar-title { font-size: 0.95rem; font-weight: 600; letter-spacing: 2px; }
.top-bar-right { display: flex; gap: 16px; }
.top-bar-link { color: var(--text-gray); text-decoration: none; font-size: 0.8rem; letter-spacing: 1px; }
.top-bar-link:hover { color: var(--text-white); }

.dashboard-main { max-width: 1240px; margin: 0 auto; padding: 28px 28px 60px; }
.dashboard-intro { margin-bottom: 24px; }
.dashboard-intro h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.dashboard-intro h2::before { content: ''; width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); }
.dashboard-intro p { font-size: 0.82rem; color: var(--text-dim); margin-left: 15px; }

.sections-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.admin-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.admin-card-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.admin-card-header h3 { font-size: 0.92rem; font-weight: 600; letter-spacing: 2px; }
.img-count { font-size: 0.72rem; color: var(--text-dim); background: var(--bg-input); padding: 3px 10px; border-radius: 20px; }
.admin-card-body { padding: 18px; }

/* URL输入表单 */
.url-form { margin-bottom: 16px; }
.url-input-row { display: flex; gap: 8px; }
.url-input { flex: 1; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-white); font-size: 0.82rem; font-family: inherit; min-width: 0; }
.url-input:focus { outline: none; border-color: var(--accent); }
.url-input::placeholder { color: var(--text-dim); }
.title-input { width: 100px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-white); font-size: 0.82rem; font-family: inherit; }
.title-input:focus { outline: none; border-color: var(--accent); }
.title-input::placeholder { color: var(--text-dim); }
.btn-add { background: var(--accent); color: var(--bg-dark); font-weight: 600; padding: 10px 18px; font-size: 0.8rem; white-space: nowrap; }
.btn-add:hover { background: #2cf0a0; }

/* 图片列表 */
.img-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.img-item { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-input); }
.img-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.img-info { padding: 4px 6px; background: rgba(0,0,0,0.5); position: absolute; bottom: 0; left: 0; right: 28px; }
.img-title { font-size: 0.62rem; color: var(--text-gray); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delete-form { position: absolute; top: 6px; right: 6px; }
.btn-delete { background: rgba(239,83,80,0.85); color: var(--text-white); border: none; width: 24px; height: 24px; border-radius: 50%; font-size: 0.68rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-delete:hover { background: var(--red-del); }
.no-img { color: var(--text-dim); font-size: 0.8rem; text-align: center; padding: 24px 0; }
.dashboard-footer { text-align: center; padding: 16px 0; border-top: 1px solid var(--border); margin-top: 40px; }
.dashboard-footer p { color: var(--text-dim); font-size: 0.72rem; letter-spacing: 2px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .top-bar { padding: 10px 16px; }
    .top-bar-title { font-size: 0.82rem; }
    .dashboard-main { padding: 20px 14px 40px; }
    .sections-grid { grid-template-columns: 1fr; gap: 16px; }
    .admin-card-body { padding: 14px; }
    .url-input-row { flex-wrap: wrap; }
    .url-input { flex: 1 1 100%; }
    .title-input { width: 1; flex: 1; }
    .btn-add { width: 100%; padding: 11px; }
    .img-list { grid-template-columns: repeat(2, 1fr); }
    .login-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .img-list { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
