﻿:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e0e3e8;
  --text: #1a1d23;
  --text-2: #5a6271;
  --text-3: #8b92a1;
  --primary: #2563eb;
  --primary-h: #1d4ed8;
  --primary-bg: #eff4ff;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --orange: #ea580c;
  --orange-bg: #fff7ed;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; font-size: 13px; border: none; border-radius: 6px; padding: 7px 14px; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #fee2e2; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
input, select, textarea { font-family: inherit; font-size: 13px; border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; outline: none; transition: border-color .15s; width: 100%; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; font-weight: 500; }
.field { margin-bottom: 14px; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1e293b; color: #cbd5e1; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-brand { padding: 20px 18px; font-size: 16px; font-weight: 700; color: #fff; border-bottom: 1px solid #334155; display: flex; align-items: center; gap: 8px; }
.nav-group-title { padding: 16px 18px 8px; font-size: 14px; font-weight: 700; color: #93c5fd; text-transform: uppercase; letter-spacing: 0.6px; border-top: 1px solid #334155; margin-top: 4px; }
.nav-group-title:first-child { padding-top: 8px; }
.nav-group { padding-bottom: 4px; }
.sidebar-brand span { font-size: 11px; color: var(--primary); background: var(--primary-bg); padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.nav-item { padding: 10px 18px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 13px; transition: all .15s; border-left: 3px solid transparent; }
.nav-item:hover { background: #334155; color: #fff; }
.nav-item.active { background: #334155; color: #fff; border-left-color: var(--primary); }
.nav-icon { width: 18px; text-align: center; }
.main { flex: 1; padding: 24px 32px; overflow-y: auto; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 700; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.stat-label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--primary); }
.stat-value.orange { color: var(--orange); }
.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #f8fafc; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.tag-draft { background: var(--bg); color: var(--text-3); }
.tag-active { background: var(--green-bg); color: var(--green); }
.tag-archived { background: var(--bg); color: var(--text-3); }
.tag-posted { background: var(--green-bg); color: var(--green); }
.tag-pending { background: var(--orange-bg); color: var(--orange); }
.tag-error { background: var(--red-bg); color: var(--red); }
.thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--bg); }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; color: var(--text-3); padding: 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.empty { text-align: center; padding: 40px; color: var(--text-3); }
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.img-card { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; }
.img-card img { width: 100%; height: 100%; object-fit: cover; }
.img-card .main-badge { position: absolute; top: 4px; left: 4px; background: var(--primary); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.img-card .img-actions { position: absolute; bottom: 0; left: 0; right: 0; display: flex; background: rgba(0,0,0,0.6); padding: 4px; gap: 4px; justify-content: center; opacity: 0; transition: opacity .15s; }
.img-card:hover .img-actions { opacity: 1; }
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; cursor: pointer; transition: all .15s; margin-bottom: 16px; }
.upload-zone:hover { border-color: var(--primary); background: var(--primary-bg); }
.link-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.link-row:last-child { border-bottom: none; }
.link-platform { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; background: var(--primary-bg); color: var(--primary); min-width: 50px; text-align: center; }
.detail-section { margin-bottom: 24px; }
.detail-section-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.push-result { padding: 16px; border-radius: var(--radius); margin-bottom: 12px; }
.push-success { background: var(--green-bg); border: 1px solid #bbf7d0; }
.push-error { background: var(--red-bg); border: 1px solid #fecaca; }
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 200; font-size: 13px; font-weight: 500; animation: slideIn .2s ease; }
.toast-success { background: var(--green); color: #fff; }
.toast-error { background: var(--red); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { display: flex; align-items: center; justify-content: center; padding: 40px; gap: 10px; color: var(--text-2); }

/* Auth / login page */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #005bff 0%, #0022cc 100%); }
.auth-card { background: #fff; border-radius: 14px; padding: 40px; width: 380px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.auth-logo { font-size: 26px; font-weight: 700; text-align: center; color: var(--text-1); }
.auth-sub { text-align: center; color: var(--text-2); font-size: 13px; margin: 6px 0 24px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.auth-tab { flex: 1; text-align: center; padding: 10px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; transition: .15s; }
.auth-tab:hover { color: var(--text-1); }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.sidebar-footer { margin-top: auto; padding: 12px 0 0; border-top: 1px solid var(--border); }
.user-info { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-1); padding: 4px 12px; }
.user-info .nav-icon { margin-right: 0; }

/* 鏀惰棌鏄熸爣 */
.fav-star { cursor: pointer; font-size: 20px; color: var(--text-3); transition: color 0.2s, transform 0.1s; user-select: none; }
.fav-star:hover { color: var(--orange); transform: scale(1.2); }
.fav-star.fav-active { color: #f5a623; }
