@charset "UTF-8";
/* ============================================
   听雨轩音乐教育 - 后台管理样式表
   布局：240px侧边栏 + 56px顶栏 + 灰色内容区
   ============================================ */

:root {
  --green: #C9A961;
  --green-light: #DDB87A;
  --green-dark: #A88840;
  --dark-green: #2A2520;
  --dark-green-2: #3A3328;
  --cream: #F8F4ED;
  --bg: #F5F7FA;
  --white: #FFFFFF;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --text: #1F2937;
  --text-light: #6B7280;
  --orange: #F59E0B;
  --orange-light: #FEF3C7;
  --green-badge: #D1FAE5;
  --yellow-badge: #FEF3C7;
  --yellow-text: #92400E;
  --red: #EF4444;
  --radius: 8px;
  --sidebar-w: 240px;
  --topbar-h: 56px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Sarasa Gothic SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* --- Admin Layout --- */
.admin-layout { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark-green);
  color: rgba(255,255,255,0.7);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
}
.sidebar-header { padding: 20px 24px; display: flex; align-items: center; gap: 10px; }
.sidebar-header .logo-icon {
  width: 36px; height: 36px;
  background: var(--green);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 700; font-size: 18px;
}
.sidebar-header .logo-text { color: var(--white); font-size: 18px; font-weight: 700; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.sidebar-nav .nav-label { font-size: 11px; color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 1px; padding: 8px 12px; }
.sidebar-nav .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 400;
  color: rgba(255,255,255,0.65);
  margin-bottom: 4px;
  transition: all .2s;
}
.sidebar-nav .nav-item .icon { font-size: 18px; width: 20px; text-align: center; }
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.sidebar-nav .nav-item.active {
  background: rgba(201,169,97,0.2);
  color: var(--white);
  font-weight: 600;
}

.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-user { display: flex; align-items: center; gap: 12px; }
.sidebar-user .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 600; font-size: 14px;
}
.sidebar-user .info .name { color: var(--white); font-size: 13px; font-weight: 500; }
.sidebar-user .info .role { color: rgba(255,255,255,0.4); font-size: 11px; }

/* --- Main Area --- */
.admin-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

/* --- Top Bar --- */
.admin-topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left h1 { font-size: 18px; font-weight: 600; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right .icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--gray-600);
  position: relative;
}
.topbar-right .icon-btn:hover { background: var(--gray-200); }
.topbar-right .icon-btn .badge {
  position: absolute; top: -2px; right: -2px;
  width: 16px; height: 16px;
  background: var(--red); color: var(--white);
  border-radius: 50%; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.topbar-right .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 600; font-size: 13px;
}

/* --- Content Area --- */
.admin-content { padding: 24px; flex: 1; }

/* --- Stat Cards --- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-card .stat-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.stat-card .stat-icon.green { background: #D1FAE5; color: #059669; }
.stat-card .stat-icon.blue { background: #DBEAFE; color: #2563EB; }
.stat-card .stat-icon.orange { background: #FEF3C7; color: #D97706; }
.stat-card .stat-icon.purple { background: #EDE9FE; color: #7C3AED; }
.stat-card .stat-trend { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; }
.stat-card .stat-trend.up { background: #D1FAE5; color: #059669; }
.stat-card .stat-trend.down { background: #FEE2E2; color: #DC2626; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-light); }

/* --- Admin Card --- */
.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 24px;
  overflow: hidden;
}
.admin-card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; justify-content: space-between; align-items: center;
}
.admin-card-header h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.admin-card-header .link { font-size: 13px; color: var(--green); font-weight: 500; }
.admin-card-body { padding: 24px; }

/* --- Quick Actions --- */
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-action {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--gray-200);
  transition: all .2s;
  cursor: pointer;
}
.quick-action:hover { border-color: var(--green); background: rgba(201,169,97,0.05); }
.quick-action .icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: rgba(201,169,97,0.15);
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.quick-action .label { font-size: 14px; font-weight: 500; color: var(--text); }
.quick-action .desc { font-size: 12px; color: var(--text-light); }

/* --- System Info --- */
.sys-info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: 13px; }
.sys-info-row:last-child { border-bottom: none; }
.sys-info-row .label { color: var(--text-light); }
.sys-info-row .value { font-weight: 500; }
.sys-info-row .value.ok { color: #059669; }
.sys-info-row .value .bar { display: inline-block; width: 80px; height: 6px; background: var(--gray-200); border-radius: 3px; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.sys-info-row .value .bar .fill { display: block; height: 100%; background: var(--green); border-radius: 3px; }

/* --- Two Column Layout --- */
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }

/* --- Filter Bar --- */
.filter-bar {
  display: flex; gap: 12px; align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar .search-input {
  flex: 1; min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  outline: none;
  font-size: 13px;
}
.filter-bar .search-input:focus { border-color: var(--green); }
.filter-bar select {
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 13px;
  color: var(--text);
  outline: none;
  cursor: pointer;
}
.filter-bar .btn-primary {
  padding: 10px 20px;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.filter-bar .btn-primary:hover { background: var(--green-dark); }

/* --- Table --- */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px; font-weight: 600;
  color: var(--text-light);
  background: var(--bg);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--text);
}
.admin-table tr:hover td { background: rgba(201,169,97,0.03); }
.admin-table .col-title { min-width: 200px; }
.admin-table .col-title a { font-weight: 500; color: var(--text); }
.admin-table .col-title a:hover { color: var(--green); }

/* --- Badges --- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.badge-green { background: var(--green-badge); color: #059669; }
.badge-orange { background: var(--orange-light); color: #92400E; }
.badge-yellow { background: var(--yellow-badge); color: var(--yellow-text); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* --- Table Actions --- */
.table-actions { display: flex; gap: 8px; }
.table-actions a { font-size: 12px; padding: 4px 10px; border-radius: 4px; }
.table-actions .edit { color: var(--green); background: rgba(201,169,97,0.1); }
.table-actions .edit:hover { background: var(--green); color: var(--white); }
.table-actions .delete { color: var(--red); background: rgba(239,68,68,0.1); }
.table-actions .delete:hover { background: var(--red); color: var(--white); }

/* --- Admin Pagination --- */
.admin-pagination { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-top: 1px solid var(--gray-100); }
.admin-pagination .info { font-size: 13px; color: var(--text-light); }
.admin-pagination .pages { display: flex; gap: 4px; }
.admin-pagination .pages a, .admin-pagination .pages span {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid var(--gray-200);
  color: var(--text);
}
.admin-pagination .pages a:hover { border-color: var(--green); color: var(--green); }
.admin-pagination .pages .active { background: var(--green); color: var(--white); border-color: var(--green); }

/* --- Article Editor --- */
.editor-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.editor-main { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.editor-title-input {
  width: 100%;
  border: none; outline: none;
  font-size: 24px; font-weight: 600;
  color: var(--text);
  padding: 8px 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}
.editor-title-input::placeholder { color: var(--gray-300); }
.editor-title-input:focus { border-bottom-color: var(--green); }

.editor-meta-row { display: flex; gap: 16px; margin-bottom: 20px; }
.editor-meta-row .field { flex: 1; }
.editor-meta-row label { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.editor-meta-row input, .editor-meta-row select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.editor-meta-row input:focus, .editor-meta-row select:focus { border-color: var(--green); }

.editor-toolbar {
  display: flex; gap: 4px; align-items: center;
  padding: 8px;
  border: 1px solid var(--gray-200);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: var(--bg);
  flex-wrap: wrap;
}
.editor-toolbar button {
  width: 32px; height: 32px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600;
  color: var(--gray-600);
}
.editor-toolbar button:hover { background: var(--gray-200); color: var(--text); }
.editor-toolbar .divider { width: 1px; height: 20px; background: var(--gray-300); margin: 0 4px; }

.editor-content {
  min-height: 400px;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: 0 0 6px 6px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  outline: none;
}
.editor-content:empty::before { content: '在这里输入正文内容...'; color: var(--gray-300); }

.editor-sidebar { display: flex; flex-direction: column; gap: 20px; }
.editor-panel { background: var(--white); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow: hidden; }
.editor-panel .panel-header { padding: 12px 16px; border-bottom: 1px solid var(--gray-200); font-size: 14px; font-weight: 600; }
.editor-panel .panel-body { padding: 16px; }
.editor-panel .field { margin-bottom: 16px; }
.editor-panel .field:last-child { margin-bottom: 0; }
.editor-panel label { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 6px; }
.editor-panel input, .editor-panel select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.editor-panel input:focus, .editor-panel select:focus { border-color: var(--green); }
.editor-panel .upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .2s;
}
.editor-panel .upload-area:hover { border-color: var(--green); color: var(--green); }
.editor-panel .upload-area .icon { font-size: 24px; margin-bottom: 8px; }
.editor-panel .radio-group { display: flex; flex-direction: column; gap: 8px; }
.editor-panel .radio-group label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.editor-panel .radio-group input[type="radio"] { width: auto; }

.editor-actions {
  display: flex; gap: 12px;
  padding: 16px 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 24px;
  justify-content: flex-end;
}
.editor-actions .btn {
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px; font-weight: 600;
}
.editor-actions .btn-draft { background: var(--gray-100); color: var(--text); }
.editor-actions .btn-draft:hover { background: var(--gray-200); }
.editor-actions .btn-publish { background: var(--green); color: var(--white); }
.editor-actions .btn-publish:hover { background: var(--green-dark); }

/* --- Media Manager --- */
.upload-zone {
  border: 2px dashed var(--green);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin-bottom: 24px;
  background: rgba(201,169,97,0.03);
  cursor: pointer;
  transition: all .2s;
}
.upload-zone:hover { background: rgba(201,169,97,0.08); }
.upload-zone .icon { font-size: 40px; color: var(--green); margin-bottom: 12px; }
.upload-zone h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-zone p { font-size: 13px; color: var(--text-light); }

.media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.media-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: box-shadow .2s;
}
.media-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.media-thumb {
  height: 150px;
  background: linear-gradient(135deg, #E8D9B5, #DDB87A);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  position: relative;
}
.media-thumb .actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 4px;
  opacity: 0;
  transition: opacity .2s;
}
.media-card:hover .media-thumb .actions { opacity: 1; }
.media-thumb .actions a {
  width: 28px; height: 28px;
  border-radius: 4px;
  background: rgba(0,0,0,0.5);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}
.media-info { padding: 12px; }
.media-info .name { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-info .meta { font-size: 11px; color: var(--text-light); }

/* --- Recent Articles List (Dashboard) --- */
.recent-list .recent-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.recent-list .recent-item:last-child { border-bottom: none; }
.recent-list .recent-item .title { flex: 1; font-size: 13px; font-weight: 500; color: var(--text); }
.recent-list .recent-item .title a:hover { color: var(--green); }
.recent-list .recent-item .date { font-size: 12px; color: var(--text-light); }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .stat-grid { grid-template-columns: 1fr; }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; }
  .filter-bar .search-input, .filter-bar select { width: 100%; }
}
