/* 余千金珠宝 · 后台管理样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif; background: #f4f1ea; color: #2a2620; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#221d16,#3a3020); padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 18px; padding: 40px 36px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.login-card .brand { text-align: center; margin-bottom: 26px; }
.login-card .brand .logo-mark { font-family: "Noto Serif SC",serif; font-size: 30px; font-weight: 700; color: #1c1a17; letter-spacing: 3px; }
.login-card .brand .logo-en { display: block; font-size: 11px; letter-spacing: .3em; color: #a8843a; margin-top: 4px; }
.login-card h2 { text-align: center; font-family: "Noto Serif SC",serif; font-size: 20px; margin-bottom: 22px; }
.login-card .field { margin-bottom: 16px; }
.login-card label { display: block; font-size: 13px; color: #6b655c; margin-bottom: 6px; }
.login-card input { width: 100%; padding: 11px 14px; border: 1px solid #e0dccf; border-radius: 10px; font-size: 15px; }
.login-card input:focus { outline: none; border-color: #c8a45c; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }
.login-hint { text-align:center; font-size:12px; color:#9a948a; margin-top:14px; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: 0 0 232px; background: #1c1a17; color: #cfc9bd; padding: 24px 16px; display: flex; flex-direction: column; }
.sidebar .sb-brand { font-family: "Noto Serif SC",serif; font-size: 20px; color: #fff; letter-spacing: 2px; padding: 6px 10px 20px; }
.sidebar .sb-brand small { display:block; font-size:10px; letter-spacing:.25em; color:#a8843a; font-family:sans-serif; margin-top:2px;}
.nav-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 4px; color: #b8b2a6; cursor: pointer; transition: .2s; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(135deg,#c8a45c,#a8843a); color: #fff; }
.nav-item svg { width: 18px; height: 18px; }
.sidebar .sb-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: #8a8478; }
.sidebar .sb-foot button { background: none; border: none; color: #c8a45c; font-size: 13px; padding: 8px 0; }

.main { flex: 1; padding: 28px 34px; overflow-x: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.topbar h1 { font-family: "Noto Serif SC",serif; font-size: 24px; font-weight: 600; }
.topbar .sub { font-size: 13px; color: #8a8478; margin-top: 2px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 999px; border: 1px solid transparent; font-size: 14px; font-weight: 600; transition: .2s; }
.btn-gold { background: linear-gradient(135deg,#c8a45c,#a8843a); color: #fff; }
.btn-gold:hover { transform: translateY(-1px); }
.btn-dark { background: #1c1a17; color: #fff; }
.btn-line { background: #fff; color: #1c1a17; border-color: #d8d2c4; }
.btn-line:hover { border-color: #c8a45c; color: #a8843a; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* 卡片 / 区块 */
.panel { background: #fff; border: 1px solid #ece7da; border-radius: 14px; padding: 22px; margin-bottom: 22px; }
.panel h3 { font-family: "Noto Serif SC",serif; font-size: 17px; margin-bottom: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.stat-box { background: #fff; border: 1px solid #ece7da; border-radius: 14px; padding: 20px; }
.stat-box .n { font-family: "Noto Serif SC",serif; font-size: 30px; color: #a8843a; font-weight: 700; }
.stat-box .l { font-size: 13px; color: #8a8478; margin-top: 4px; }

/* 表格 */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #f0ece2; vertical-align: middle; }
.table th { font-size: 12px; color: #8a8478; font-weight: 600; letter-spacing: .04em; background: #faf8f3; }
.table tbody tr:hover { background: #faf8f3; }
.table .thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #eee; }
.table .acts { display: flex; gap: 8px; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #f0ece2; color: #6b655c; }
.tag.on { background: #f3e8cf; color: #a8843a; }
.tag.unread { background: #f7dcdc; color: #b4453a; }

/* 表单 / 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(28,26,23,.5); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 200; overflow-y: auto; }
.modal-mask.open { display: flex; }
.modal { width: 100%; max-width: 560px; background: #fff; border-radius: 16px; padding: 28px 30px; }
.modal h3 { font-family: "Noto Serif SC",serif; font-size: 19px; margin-bottom: 20px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; color: #6b655c; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; padding: 10px 13px; border: 1px solid #e0dccf; border-radius: 9px; font-size: 14px; font-family: inherit; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: #c8a45c; }
.field textarea { resize: vertical; min-height: 90px; }
.field .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #4a4540; }
.check input { width: 16px; height: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.img-prev { margin-top: 10px; }
.img-prev img { max-height: 120px; border-radius: 8px; border: 1px solid #ece7da; }
.img-gallery { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; }
.g-empty { color: #a39c8e; font-size: 13px; padding: 14px; border: 1px dashed #ddd6c8; border-radius: 8px; width: 100%; text-align: center; }
.g-item { position: relative; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid #e6e0d3; background: #faf8f3; }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; line-height: 18px; text-align: center; border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; cursor: pointer; padding: 0; }
.g-set { position: absolute; bottom: 3px; left: 3px; right: 3px; border: none; background: rgba(200,164,92,.92); color: #fff; font-size: 11px; padding: 2px 0; border-radius: 5px; cursor: pointer; }
.g-cover { position: absolute; bottom: 3px; left: 3px; right: 3px; text-align: center; background: rgba(0,0,0,.6); color: #ffd98a; font-size: 11px; padding: 2px 0; border-radius: 5px; }
.video-gallery { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 12px; }
.v-item { position: relative; width: 180px; border-radius: 10px; overflow: hidden; border: 1px solid #e6e0d3; background: #000; }
.v-item video { width: 100%; height: 130px; object-fit: cover; display: block; background: #000; }
.v-del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; line-height: 18px; text-align: center; border: none; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; cursor: pointer; padding: 0; }
.v-tag { position: absolute; bottom: 4px; left: 4px; background: rgba(200,164,92,.92); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 5px; }
.upload-btn { display:inline-block; padding:8px 16px; background:#f4f1ea; border:1px dashed #cfc9bd; border-radius:8px; font-size:13px; color:#6b655c; cursor:pointer;}
.gold-preview { margin-top: 4px; padding: 12px 14px; background: linear-gradient(135deg,#fbf6ea,#f6efe0); border: 1px solid #e7d9b8; border-radius: 10px; font-size: 14px; color: #8a6d2f; }
.gold-preview b { font-size: 20px; color: #a8843a; font-family: "Songti SC","SimSun",serif; }
.gold-preview .formula { display:block; font-size: 12px; color: #b0a07a; margin-top: 4px; }
.upload-btn:hover { border-color:#c8a45c; color:#a8843a; }

.empty { text-align: center; color: #9a948a; padding: 40px 0; }

/* 富文本编辑器 */
.richeditor { border: 1px solid #e0dccf; border-radius: 9px; padding: 12px 14px; min-height: 240px; line-height: 1.8; font-size: 15px; background: #fff; outline: none; }
.richeditor:focus { border-color: #c8a45c; }
.richeditor img { max-width: 100%; border-radius: 6px; margin: 6px 0; }
.re-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.re-hint { color: #b0a690; font-size: 12px; }
#ed-state { color: #a8843a; font-size: 12px; min-height: 16px; }
.toast { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px); background: #1c1a17; color: #fff; padding: 12px 22px; border-radius: 999px; font-size: 14px; opacity: 0; transition: .3s; z-index: 999; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.muted { color:#9a948a; font-size:13px; }
.hidden { display: none !important; }
.gold-readout { background:#faf8f3; border:1px solid #ece7da; border-radius:10px; padding:14px 16px; margin-top:6px; }
.gold-readout > div { display:flex; justify-content:space-between; align-items:baseline; padding:6px 0; border-bottom:1px dashed #eadfca; }
.gold-readout > div:last-child { border-bottom:none; }
.gold-readout span { color:#6b655c; font-size:13px; }
.gold-readout b { font-size:15px; color:#3a352c; }
.gold-readout b.hl { color:#a8843a; font-weight:700; }

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 12px; }
  .sidebar .sb-brand { width: 100%; padding: 4px 8px 10px; }
  .nav-item { margin: 0; }
  .sidebar .sb-foot { width: 100%; border: none; }
  .main { padding: 20px 16px; }
  .stat-row { grid-template-columns: repeat(2,1fr); }
  .field .row2 { grid-template-columns: 1fr; }
}
