:root {
  --primary-blue: #165dff;
  --primary-blue-hover: #4080ff;
  --primary-blue-light: #e8f3ff;
  --bg-color: #f2f3f5;
  --surface-color: #FFFFFF;
  --text-main: #1d2129;
  --text-regular: #4e5969;
  --text-minor: #86909c;
  --border-color: #e5e6eb;
  --input-bg: #f2f3f5;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Layout */
.admin-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}

.brand {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
}

.brand-dot {
  width: 8px;
  height: 8px;
  background-color: var(--xhs-red);
  border-radius: 50%;
  margin-right: 10px;
}

.nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-regular);
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: var(--input-bg);
  color: var(--text-main);
}

.nav-item.active {
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
  font-weight: 600;
}

.nav-item svg {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  height: 64px;
  background: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
}

.header-title {
  font-size: 16px;
  font-weight: 600;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-regular);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* Common Components */
.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-main);
  padding-top: 16px;
}

.section-title:first-child {
  padding-top: 0;
}

.grid-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.data-card {
  background: var(--surface-color);
  border-radius: var(--radius-md);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.data-label {
  font-size: 14px;
  color: var(--text-regular);
  margin-bottom: 8px;
}

.data-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  font-family: 'DIN Alternate', -apple-system, sans-serif;
}

.trend-card {
  position: relative;
  overflow: hidden;
}

.trend-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.05) 0%, rgba(22, 93, 255, 0) 100%);
  border-bottom-left-radius: 100%;
}

.data-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--primary-blue);
}

.data-trend svg {
  width: 14px;
  height: 14px;
}

/* Panels */
.panel {
  background: var(--surface-color);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
}

.panel-desc {
  font-size: 13px;
  color: var(--text-minor);
  margin-top: 4px;
  font-weight: normal;
}

.panel-body {
  padding: 24px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-main);
  background-color: var(--input-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  background-color: var(--surface-color);
  border-color: var(--primary-blue);
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

.form-actions {
  margin-top: 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-primary {
  background-color: var(--primary-blue);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--primary-blue-hover);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: #d9d9d9;
  color: var(--text-main);
  background-color: #fafafa;
}

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

/* Tables / Lists */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  color: var(--text-minor);
  font-weight: 500;
  font-size: 13px;
  background: #FAFAFA;
}

.data-table td {
  color: var(--text-main);
  font-size: 14px;
}

.data-table tbody tr:hover {
  background-color: #FAFAFA;
}

.text-minor {
  color: var(--text-minor);
  font-size: 13px;
}

/* Multi-column layouts inside panels */
.panel-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.item-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-color);
  display: flex;
  flex-direction: column;
}

.item-card-cover {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--input-bg);
}

.item-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.item-card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-card-meta {
  color: var(--text-minor);
  font-size: 12px;
  margin-bottom: 16px;
}

.item-card-actions {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

/* Tags/Chips */
.tag {
  display: inline-flex;
  padding: 4px 10px;
  background: var(--input-bg);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-regular);
}

.tag.red {
  background: var(--primary-blue-light);
  color: var(--primary-blue);
}

.mood-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.mood-stat-item {
  flex: 1;
  min-width: 100px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.mood-stat-label {
  font-size: 13px;
  color: var(--text-regular);
  margin-bottom: 8px;
}

.mood-stat-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-main);
}

/* Image preview */
.img-preview {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  margin-top: 12px;
  display: block;
}

/* Layout Utilities */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-16 {
  gap: 16px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.quick-action-btn:hover {
  background: var(--surface-color);
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(22, 93, 255, 0.08);
}

.quick-action-btn svg {
  width: 18px;
  height: 18px;
  color: var(--primary-blue);
}

.logout-form {
  margin: 0;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f7f9fc, #eef3ff);
}

.login-shell {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.login-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(22, 93, 255, 0.08);
  padding: 28px;
}

.login-brand {
  font-size: 14px;
  color: var(--primary-blue);
  font-weight: 600;
  margin-bottom: 8px;
}

.login-title {
  font-size: 24px;
  margin-bottom: 16px;
}

.login-form {
  margin-top: 8px;
}

.login-submit {
  width: 100%;
}

.login-error {
  margin-top: 8px;
  margin-bottom: 12px;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #d4380d;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
}
