/* ============================================================
   朱若妍美术学习系统 — 全局样式
   设计规范：禁用深蓝 / 禁用橙黄渐变按钮 / 浅色科技绿渐变背景
   ============================================================ */

:root {
  --brand: #17a673;
  --brand-600: #12996a;
  --brand-500: #1fb87f;
  --brand-100: #e6f7f1;
  --brand-50: #f2fbf7;

  --ink: #1f2933;
  --ink-2: #4b5563;
  --ink-3: #8792a2;
  --line: #e6eae8;
  --line-2: #eff2f1;

  --bg: #f5faf7;
  --card: #ffffff;

  --ok: #17a673;
  --warn: #d99a2b;
  --danger: #d9534f;
  --info: #3f8fd9;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 166, 115, .05), 0 8px 24px rgba(31, 41, 51, .06);
  --shadow-lg: 0 12px 40px rgba(31, 41, 51, .12);

  --nav-h: 60px;
  --side-w: 216px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 8% -10%, #e3f7ee 0%, rgba(227, 247, 238, 0) 60%),
    radial-gradient(900px 500px at 100% 0%, #eaf6fb 0%, rgba(234, 246, 251, 0) 55%),
    linear-gradient(180deg, #f7fcfa 0%, #f2f8f5 100%);
  background-attachment: fixed;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand); }

/* ---------------- 布局 ---------------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line-2);
}
.brand .logo {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #35c391 0%, #17a673 100%);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
  box-shadow: 0 4px 12px rgba(23, 166, 115, .28);
}
.brand .tt { min-width: 0; }
.brand .t1 { font-weight: 700; font-size: 14px; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .t2 { font-size: 11px; color: var(--ink-3); }

.nav { padding: 10px 10px 20px; overflow-y: auto; flex: 1; }
.nav .grp { font-size: 11px; color: var(--ink-3); padding: 12px 10px 6px; letter-spacing: .5px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: 2px;
  transition: .16s;
}
.nav a:hover { background: var(--brand-50); color: var(--brand-600); }
.nav a.on { background: var(--brand-100); color: var(--brand-600); font-weight: 600; }
.nav a .ic { width: 18px; text-align: center; font-size: 15px; opacity: .9; }
.nav a .badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 11px; padding: 1px 6px; border-radius: 8px; font-weight: 600;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--nav-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16px; margin: 0; font-weight: 700; }
.topbar .sp { flex: 1; }
.topbar .who {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-2);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #35c391, #17a673);
  color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
}

.content { padding: 22px; max-width: 1440px; width: 100%; }

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}
.card > .hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-2);
}
.card > .hd h3 { margin: 0; font-size: 14px; font-weight: 700; }
.card > .hd .sp { flex: 1; }
.card > .bd { padding: 18px; }
.card > .bd.tight { padding: 12px; }

/* ---------------- 统计块 ---------------- */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 74px; height: 74px; border-radius: 50%;
  background: radial-gradient(circle, rgba(23,166,115,.10) 0%, rgba(23,166,115,0) 70%);
}
.stat .k { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.stat .v { font-size: 25px; font-weight: 700; letter-spacing: -.5px; line-height: 1.15; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.stat .d { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.stat.g .v { color: var(--brand-600); }
.stat.r .v { color: var(--danger); }
.stat.w .v { color: var(--warn); }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: .16s;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { border-color: var(--brand-500); color: var(--brand-600); background: var(--brand-50); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px rgba(23,166,115,.25);
}
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }

.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--brand-50); }

.btn.danger { color: var(--danger); border-color: #f3d7d6; }
.btn.danger:hover { background: #fdf3f3; border-color: var(--danger); color: var(--danger); }

.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.lg { height: 42px; padding: 0 22px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }

/* ---------------- 表单 ---------------- */

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=time],
input[type=search], input[type=tel], select, textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: .16s;
}
textarea { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; line-height: 1.65; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(23,166,115,.12);
}
input::placeholder, textarea::placeholder { color: #b3bcb8; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border: 1px solid var(--line); border-radius: 20px;
  font-size: 12.5px; cursor: pointer; user-select: none; background: #fff;
  transition: .16s;
}
.chip:hover { border-color: var(--brand-500); }
.chip.on { background: var(--brand-100); border-color: var(--brand-500); color: var(--brand-600); font-weight: 600; }
.chip input { display: none; }

/* ---------------- 表格 ---------------- */

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-weight: 600; color: var(--ink-3);
  font-size: 12px; padding: 10px 12px; background: #fafcfb;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tbody tr:hover { background: #fbfdfc; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl .num { font-variant-numeric: tabular-nums; }

/* ---------------- 标签 ---------------- */

.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 1.6; }
.tag.g { background: var(--brand-100); color: var(--brand-600); }
.tag.w { background: #fdf5e6; color: #b9801f; }
.tag.r { background: #fdeeee; color: var(--danger); }
.tag.i { background: #eaf2fb; color: var(--info); }
.tag.n { background: #f2f4f3; color: var(--ink-3); }

/* ---------------- 空态 ---------------- */

.empty { text-align: center; padding: 46px 20px; color: var(--ink-3); }
.empty .ic { font-size: 40px; opacity: .35; margin-bottom: 10px; }
.empty p { margin: 0 0 14px; font-size: 13.5px; }

/* ---------------- 作品网格 ---------------- */

.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.work {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; transition: .18s; cursor: pointer; position: relative;
}
.work:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: #cfe9de; }
.work .thumb { width: 100%; aspect-ratio: 4/3; background: #f4f7f6; display: block; object-fit: cover; }
.work .meta { padding: 10px 12px 12px; }
.work .meta .t { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work .meta .s { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.work .score-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(23,166,115,.94); color: #fff;
  font-weight: 700; font-size: 14px; padding: 3px 10px; border-radius: 20px;
  box-shadow: 0 3px 10px rgba(23,166,115,.35);
  backdrop-filter: blur(4px);
}
.work .score-badge.none { background: rgba(255,255,255,.92); color: var(--ink-3); font-weight: 600; font-size: 11.5px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.work .date-band {
  position: absolute; left: 10px; top: 10px;
  background: rgba(0,0,0,.42); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 6px;
  backdrop-filter: blur(4px);
}

/* 按日期分组 */
.date-group { margin-bottom: 26px; }
.date-head {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  padding-bottom: 8px; border-bottom: 1px dashed var(--line);
}
.date-head .d { font-weight: 700; font-size: 14px; }
.date-head .w { font-size: 12px; color: var(--ink-3); }
.date-head .sp { flex: 1; }

/* ---------------- 弹窗 ---------------- */

.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(31,41,51,.42);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98) } to { opacity: 1; transform: none } }

.modal {
  background: #fff; border-radius: 16px;
  width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 70px rgba(31,41,51,.26);
  animation: pop .2s cubic-bezier(.2,.9,.3,1.1);
}
.modal.wide { max-width: 900px; }
.modal.narrow { max-width: 420px; }
.modal > .hd {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--line-2);
}
.modal > .hd h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal > .hd .sp { flex: 1; }
.modal > .hd .x {
  border: none; background: transparent; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--ink-3); padding: 2px 6px; border-radius: 6px;
}
.modal > .hd .x:hover { background: #f2f4f3; color: var(--ink); }
.modal > .bd { padding: 20px; overflow-y: auto; flex: 1; }
.modal > .ft {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fbfdfc;
  border-radius: 0 0 16px 16px;
}
.modal > .ft .sp { flex: 1; }

/* ---------------- 提示条 ---------------- */

.toasts { position: fixed; top: 18px; right: 18px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 200px; max-width: 380px;
  background: #fff; border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px; padding: 11px 15px;
  box-shadow: 0 10px 30px rgba(31,41,51,.14);
  font-size: 13.5px;
  animation: slide .22s cubic-bezier(.2,.9,.3,1);
}
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }
@keyframes slide { from { opacity: 0; transform: translateX(24px) } to { opacity: 1; transform: none } }

/* ---------------- 其他 ---------------- */

.hint-bar {
  background: linear-gradient(90deg, #eafaf3 0%, #f4fbf8 100%);
  border: 1px solid #d4efe3;
  color: var(--brand-600);
  border-radius: 10px; padding: 11px 15px; font-size: 13px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 9px;
}
.hint-bar.warn { background: #fdf8ec; border-color: #f2e3c2; color: #9a6b12; }
.hint-bar.danger { background: #fdf3f3; border-color: #f3d7d6; color: var(--danger); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .sp { flex: 1; }
.toolbar input, .toolbar select { width: auto; min-width: 130px; }

.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, Consolas, Menlo, monospace; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mb0 { margin-bottom: 0 } .mb8 { margin-bottom: 8px } .mb14 { margin-bottom: 14px } .mt14 { margin-top: 14px }
.flex { display: flex; align-items: center; gap: 10px; }
.flex.sp-between { justify-content: space-between; }

.loading { text-align: center; padding: 40px; color: var(--ink-3); font-size: 13px; }

/* 进度条 */
.pbar { height: 6px; background: #eef2f0; border-radius: 4px; overflow: hidden; }
.pbar > i { display: block; height: 100%; background: linear-gradient(90deg, #35c391, #17a673); border-radius: 4px; transition: width .5s; }
.pbar.warn > i { background: linear-gradient(90deg, #e8bb63, #d99a2b); }
.pbar.danger > i { background: linear-gradient(90deg, #e78b88, #d9534f); }

/* 时间轴 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ''; position: absolute; left: -22px; top: 5px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--brand);
}
.tl-item.dim::before { border-color: var(--line); }
.tl-item .tt { font-weight: 600; font-size: 13.5px; }
.tl-item .ss { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* 上传区 */
.dropzone {
  border: 2px dashed #cfe9de; border-radius: 14px;
  background: linear-gradient(180deg, #fafefc, #f4fbf8);
  padding: 34px 20px; text-align: center; cursor: pointer; transition: .18s;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand-500); background: #eefaf4; }
.dropzone .ic { font-size: 38px; opacity: .55; margin-bottom: 8px; }
.dropzone .t1 { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.dropzone .t2 { font-size: 12.5px; color: var(--ink-3); }

.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 14px; }
.preview { position: relative; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.preview img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.preview .rm {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.5); color: #fff; font-size: 13px; line-height: 1; cursor: pointer;
}
.preview .rm:hover { background: var(--danger); }
.preview .nm { font-size: 10.5px; color: var(--ink-3); padding: 3px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 图片查看器 */
.viewer { position: fixed; inset: 0; z-index: 400; background: rgba(18,24,28,.92); display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 92vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.viewer .close { position: absolute; top: 20px; right: 24px; color: #fff; font-size: 30px; cursor: pointer; line-height: 1; opacity: .8; }
.viewer .close:hover { opacity: 1; }
.viewer .nav {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 12px;
}
.viewer .nav button {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff;
  border-radius: 9px; height: 36px; padding: 0 18px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.viewer .nav button:hover { background: rgba(255,255,255,.28); }

/* 星星评分 */
.stars { display: inline-flex; gap: 3px; cursor: pointer; }
.stars i { font-style: normal; font-size: 22px; color: #dfe5e2; transition: .12s; line-height: 1; }
.stars i.on { color: #f0b429; }
.stars i:hover { transform: scale(1.15); }

/* 响应式：窄屏收起侧栏 */
@media (max-width: 860px) {
  .layout { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 150;
    transform: translateX(-100%); transition: transform .24s; box-shadow: 0 0 40px rgba(0,0,0,.18);
  }
  .sidebar.open { transform: none; }
  .content { padding: 14px; }
  .topbar { padding: 0 14px; }
  .menu-btn { display: inline-flex !important; }
  .works { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat .v { font-size: 20px; }
}
.menu-btn { display: none; }
.mask-side { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 140; }

/* 分段切换控件（登录日志 / 操作日志切换等） */
.seg { display: inline-flex; background: var(--line-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; height: 28px; padding: 0 16px; border-radius: 7px;
  font-size: 13px; font-family: inherit; color: var(--ink-2); cursor: pointer; transition: .14s; white-space: nowrap;
}
.seg button:hover { color: var(--brand-600); }
.seg button.on { background: #fff; color: var(--brand-600); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
