:root {
  --bg: #08131a;
  --bg-soft: #10222d;
  --panel: rgba(10, 22, 29, 0.82);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f6f3ea;
  --muted: rgba(246, 243, 234, 0.72);
  --accent: #ff8c42;
  --accent-rgb: 255, 140, 66;
  --accent-deep: #d85c11;
  --secondary: #2eb7a6;
  --secondary-deep: #1d7e73;
  --danger: #ff5b53;
  --success: #3dcf8e;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(46, 183, 166, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 140, 66, 0.18), transparent 26%),
    linear-gradient(180deg, #08131a 0%, #10202b 52%, #08131a 100%);
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

/* 下拉框高对比度 */
select {
  background-color: #0d1b24;
  border: 2px solid rgba(255, 140, 66, 0.4);
  cursor: pointer;
}

select:hover {
  border-color: var(--accent);
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.2);
  outline: none;
}

/* 下拉选项样式 */
select option {
  background-color: #0d1b24;
  color: var(--text);
  padding: 10px;
}

select option:hover,
select option:focus,
select option:checked {
  background-color: var(--accent);
  color: #fff;
}

.ambient {
  position: fixed;
  width: 26rem;
  height: 26rem;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

.ambient-left {
  top: -8rem;
  left: -8rem;
  background: rgba(46, 183, 166, 0.22);
}

.ambient-right {
  top: 8rem;
  right: -10rem;
  background: rgba(255, 140, 66, 0.2);
}

.shell,
.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1380px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.auth-shell {
  width: min(1120px, calc(100vw - 40px));
  padding-top: 56px;
}

.page-auth {
  display: grid;
  place-items: center;
}

.topbar,
.hero-card,
.panel-card {
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(6, 13, 18, 0.78);
}

.topbar-brand {
  flex: 1;
  min-width: 0;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  gap: 5px;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.topbar-nav,
.hero-meta,
.resource-meta,
.admin-resource-actions,
.checkbox-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brandline {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.brandline h1,
.hero-card h1,
.hero-card h2,
.section-head h3,
.auth-panel h2 {
  margin: 0;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  letter-spacing: -0.04em;
}

.hero-card {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 140, 66, 0.08), transparent 34%),
    linear-gradient(225deg, rgba(46, 183, 166, 0.1), transparent 40%),
    rgba(8, 18, 25, 0.84);
}

.portal-hero,
.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 1.25rem;
}

.hero-copy p,
.section-head p,
.auth-panel p,
.resource-card p,
.admin-resource-card p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-meta span,
.resource-meta span,
.chat-status span,
.resource-kind,
.resource-visibility,
.role-badge {
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.84rem;
}

.resource-kind,
.role-guest {
  color: #8cf5e7;
}

.resource-visibility,
.role-admin {
  color: #ffc499;
}

.hero-stats,
.content-column,
.side-column,
.chat-panel,
.stack-form,
.chat-form {
  display: grid;
  gap: 16px;
}

.hero-stats {
  position: relative;
  z-index: 100;
}

.stat-card {
  padding: 1.15rem 1.2rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.stat-card strong {
  display: block;
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
}

/* Hero 区域统计下拉 */
.stat-dropdown {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.stat-dropdown:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 140, 66, 0.3);
}

.stat-dropdown-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dropdown-arrow {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
  transition: transform 0.2s;
}

.stat-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.stat-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  padding: 8px 0;
  background: rgba(8, 19, 26, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 10000;
  min-width: 220px;
}

.stat-dropdown.active .stat-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu-header {
  padding: 8px 16px;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.dropdown-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}

.dropdown-menu-item:hover {
  background: rgba(255, 140, 66, 0.15);
}

.dropdown-menu-item .item-label {
  font-size: 0.9rem;
}

.dropdown-menu-item .item-count {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

.dropdown-menu-footer {
  padding: 10px 16px;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.portal-layout {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.admin-layout {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.admin-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
}

.panel-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.25rem;
  margin-bottom: 18px;
}

.section-head.compact {
  align-items: start;
}

.section-index,
.eyebrow {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
}

.resource-grid,
.admin-resource-grid,
.auth-grid {
  display: grid;
  gap: 16px;
}

.resource-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.admin-resource-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.auth-grid {
  margin-top: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-panel,
.resource-card,
.admin-resource-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  padding: 18px;
}

.resource-card,
.admin-resource-card {
  display: grid;
  gap: 12px;
}

.resource-topline,
.admin-section-title,
.checkbox-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chat-panel {
  position: sticky;
  top: 24px;
}

.chat-log {
  display: grid;
  gap: 12px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 6px;
}

.chat-message {
  display: grid;
  gap: 6px;
}

.chat-role {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.8rem;
}

.chat-bubble {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(255, 255, 255, 0.05);
}

.chat-message.user .chat-bubble {
  background: rgba(255, 140, 66, 0.12);
}

.chat-message.assistant .chat-bubble {
  background: rgba(46, 183, 166, 0.1);
}

.field {
  display: grid;
  gap: 8px;
}

.field small {
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-span-2 {
  grid-column: span 2;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.78rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff7f0;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-deep));
  color: #effffc;
}

.btn-accent {
  background: linear-gradient(135deg, #f0b24b, #df6d17);
  color: #21130a;
}

.btn-danger {
  background: rgba(255, 91, 83, 0.14);
  color: #ffb2ae;
  border: 1px solid rgba(255, 91, 83, 0.22);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.flash {
  margin-top: 18px;
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
}

.flash-success {
  background: rgba(61, 207, 142, 0.12);
  color: #aef2ce;
}

.flash-error {
  background: rgba(255, 91, 83, 0.12);
  color: #ffbbb7;
}

.empty-state {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.admin-section-list + .admin-section-list {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hidden {
  display: none;
}

.truncate {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .portal-layout,
  .admin-layout,
  .portal-hero,
  .admin-hero,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    position: static;
  }
}

/* 单页布局 */
.single-column {
  grid-template-columns: minmax(0, 1fr);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* 资源详情页 */
.resource-detail-card {
  padding: 32px;
}

.resource-detail-header {
  text-align: center;
}

.resource-detail-meta {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.resource-kind.large {
  font-size: 1.1rem;
  padding: 0.5rem 1rem;
}

.resource-category {
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 140, 66, 0.12);
  color: var(--accent);
  font-size: 0.84rem;
}

.resource-title {
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.resource-description {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.resource-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.info-value {
  font-size: 0.95rem;
  color: var(--text);
}

.info-item-full {
  grid-column: 1 / -1;
}

.resource-url-link {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  transition: opacity 0.2s ease;
}

.resource-url-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.resource-actions-large {
  margin-top: 32px;
}

.resource-actions-large .btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

/* 系统文档卡片样式 */
.system-docs-card {
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.05) 0%, transparent 100%);
}

.system-docs-card .section-head {
  border-bottom-color: rgba(var(--accent-rgb), 0.2);
}

.docs-quick-access {
  font-size: 0.9rem;
}

.docs-intro {
  color: var(--text);
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.docs-usage-hint {
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(var(--accent-rgb), 0.08);
  border-radius: var(--radius-sm);
}

.docs-usage-hint strong {
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
}

.docs-usage-hint p {
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.hint-code {
  display: block;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(var(--accent-rgb), 0.4);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: monospace;
  font-size: 0.85rem;
}

.docs-details {
  margin-top: 12px;
}

.docs-details summary {
  cursor: pointer;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  transition: background 0.2s ease;
}

.docs-details summary:hover {
  background: rgba(255, 255, 255, 0.08);
}

.docs-details[open] summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: rgba(var(--accent-rgb), 0.1);
}

.docs-content {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-top: none;
}

.docs-content h5 {
  color: var(--accent);
  font-size: 0.85rem;
  margin: 16px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.docs-content h5:first-child {
  margin-top: 0;
}

.docs-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}

.docs-list li {
  padding: 4px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.docs-list li strong {
  color: var(--text);
}

.docs-list.warning li {
  color: #ef4444;
}

.docs-code {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 8px 0;
  overflow-x: auto;
}

.docs-code code {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text);
  white-space: pre-wrap;
}

.docs-full-link {
  margin-top: 16px;
  width: 100%;
  text-align: center;
}

/* 多文件资源样式 */
.upload-files-section {
  width: 100%;
}

.upload-files-section h4 {
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 1rem;
}

.upload-files-list {
  display: grid;
  gap: 8px;
}

.upload-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.upload-file-item .file-index {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  min-width: 30px;
}

.upload-file-item .file-name {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-item .file-size {
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 80px;
  text-align: right;
}

.upload-file-item .btn-small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* 评论区域 */
.comments-card {
  margin-top: 24px;
}

.comments-list {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.comment-item {
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.comment-author {
  font-weight: 600;
  color: var(--text);
}

.admin-badge {
  padding: 2px 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.comment-time {
  color: var(--muted);
  font-size: 0.8rem;
}

.comment-content {
  color: var(--text);
  line-height: 1.7;
  white-space: pre-wrap;
}

.comment-form {
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.comment-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.char-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  min-height: 32px;
}

/* 搜索页面 */
.search-panel {
  margin-top: 24px;
}

.search-form {
  margin-bottom: 20px;
}

.search-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-icon {
  font-size: 1.5rem;
}

.search-input {
  flex: 1;
  font-size: 1.1rem;
  padding: 1rem 1.2rem;
}

.search-btn {
  padding: 1rem 2rem;
}

.search-info {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.search-tip {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--accent);
}

.search-results {
  margin-top: 24px;
}

.results-grid {
  display: grid;
  gap: 16px;
}

.search-result-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.result-header {
  margin-bottom: 12px;
}

.result-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.result-category {
  padding: 0.2rem 0.6rem;
  background: rgba(46, 183, 166, 0.12);
  color: var(--secondary);
  border-radius: 999px;
  font-size: 0.8rem;
}

.result-title {
  margin: 0 0 10px 0;
}

.result-title a {
  color: var(--text);
}

.result-title a:hover {
  color: var(--accent);
}

.result-description {
  color: var(--muted);
  margin-bottom: 12px;
}

.result-details {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.result-actions {
  display: flex;
  gap: 10px;
}

.empty-search {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.search-tips ul {
  margin: 16px 0 0 0;
  padding-left: 20px;
  color: var(--muted);
}

.search-tips li {
  margin-bottom: 8px;
}

/* 资源类型选择器 */
.resource-type-selector {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.type-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s ease;
}

.type-option:hover {
  border-color: rgba(255, 140, 66, 0.4);
  background: rgba(255, 140, 66, 0.05);
}

.type-option input[type="radio"] {
  display: none;
}

.type-option input[type="radio"]:checked + .type-icon,
.type-option:has(input:checked) {
  border-color: var(--accent);
  background: rgba(255, 140, 66, 0.1);
}

.type-option:has(input:checked) .type-icon {
  transform: scale(1.1);
}

.type-icon {
  font-size: 2rem;
  transition: transform 0.2s;
}

.type-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

/* 统一表单 */
.unified-form .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 文件上传区域简化 */
.file-upload-wrapper {
  margin-top: 8px;
}

.file-upload-wrapper > span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text);
}

/* 文件列表 */
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
}

.file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.file-item .file-size {
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.file-item .file-label-input {
  width: 150px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

/* 旧样式保留 */
.resource-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  border-color: transparent;
}

/* 分段式文件上传 */
.file-upload-section {
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 600;
}

.upload-status {
  font-size: 0.85rem;
  color: var(--secondary);
}

/* 拖拽上传区域 */
.file-drop-zone {
  position: relative;
  padding: 40px 20px;
  border: 2px dashed rgba(255, 140, 66, 0.3);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.file-drop-zone:hover {
  border-color: var(--accent);
  background: rgba(255, 140, 66, 0.05);
}

.file-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(255, 140, 66, 0.1);
  transform: scale(1.02);
}

.file-input-multiple {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.drop-icon {
  font-size: 3rem;
  opacity: 0.8;
}

.drop-zone-text span {
  color: var(--text);
  font-size: 1rem;
}

.drop-zone-text small {
  color: var(--muted);
  font-size: 0.85rem;
}

/* 文件列表 */
.upload-files-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
}

.staged-file-item {
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.file-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.staged-file-name {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.staged-file-size {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.file-label-row {
  display: flex;
}

.file-label-edit {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.file-label-edit:focus {
  border-color: var(--accent);
  outline: none;
}

.upload-actions {
  display: flex;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-progress {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* 资源编辑表单 */
.resource-edit-form {
  margin: 12px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* 追加文件区域（批量上传模式） */
.add-more-files {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.file-drop-zone-sm {
  position: relative;
  padding: 16px;
  border: 2px dashed rgba(255, 140, 66, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.file-drop-zone-sm:hover {
  border-color: var(--accent);
  background: rgba(255, 140, 66, 0.05);
}

.file-drop-zone-sm.drag-over {
  border-color: var(--accent);
  background: rgba(255, 140, 66, 0.1);
}

.file-input-multiple-sm {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-text-sm {
  font-size: 0.85rem;
  color: var(--muted);
  pointer-events: none;
}

.append-files-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 200px;
  overflow-y: auto;
  position: relative;
  z-index: 60;
}

/* 修复文件项的缩放和定位 */
.append-file-item {
  position: relative;
  z-index: 70;
}

.append-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.append-file-item .file-name {
  flex: 1;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.append-file-item .file-size {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.append-file-item .file-label-input {
  width: 100px;
  padding: 4px 8px;
  font-size: 0.8rem;
}

.append-actions {
  display: flex;
  gap: 10px;
}

.append-progress {
  margin-top: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

/* 文件项样式 */
.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.delete-file-form {
  margin: 0;
}

.empty-files {
  padding: 12px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* 资源文件列表（后台管理） */
.resource-files-list {
  margin-top: 8px;
  position: relative;
  z-index: 10;
}

.resource-files-list .files-details {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: visible;
}

.files-details-content {
  padding: 0 14px 14px;
}

/* 追加文件区域在details外部 */
.resource-files-list .add-more-files {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 140, 66, 0.05);
  border: 1px dashed rgba(255, 140, 66, 0.3);
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 50;
}

.resource-files-list summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  user-select: none;
}

.resource-files-list summary:hover {
  color: var(--text);
}

.resource-files-list ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.resource-files-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.resource-files-list li:last-child {
  border-bottom: none;
}

.resource-files-list .file-label {
  flex: 1;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-files-list .file-size {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.resource-files-list .file-download-link {
  color: var(--secondary);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(46, 183, 166, 0.1);
  white-space: nowrap;
}

.resource-files-list .file-download-link:hover {
  background: rgba(46, 183, 166, 0.18);
}

/* 多文件徽章 */
.multi-file-badge,
.file-count-badge {
  background: rgba(255, 140, 66, 0.15);
  color: var(--accent);
}

/* 下载选项面板 */
.download-options {
  margin-top: 12px;
  padding: 16px;
  background: rgba(8, 19, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  position: absolute;
  z-index: 100;
  min-width: 280px;
  max-width: 320px;
  box-shadow: var(--shadow);
}

.download-options-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  font-weight: 600;
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: normal;
  color: var(--muted);
  cursor: pointer;
}

.select-all-label input {
  width: auto;
  margin: 0;
}

.download-files-list {
  display: grid;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.download-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.download-file-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* 高对比度复选框 - 更醒目的样式 */
.download-file-item input[type="checkbox"],
.select-all-label input[type="checkbox"],
.checkbox-line input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.9);
  border: 3px solid var(--accent);
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: inline-block;
  vertical-align: middle;
  transition: all 0.15s ease;
}

.download-file-item input[type="checkbox"]:hover,
.select-all-label input[type="checkbox"]:hover,
.checkbox-line input[type="checkbox"]:hover {
  background: #fff;
  border-color: #ff6b1a;
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.3);
}

.download-file-item input[type="checkbox"]:checked,
.select-all-label input[type="checkbox"]:checked,
.checkbox-line input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.download-file-item input[type="checkbox"]:checked::after,
.select-all-label input[type="checkbox"]:checked::after,
.checkbox-line input[type="checkbox"]:checked::after {
  content: "✓";
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.download-file-item input[type="checkbox"]:focus,
.select-all-label input[type="checkbox"]:focus,
.checkbox-line input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 140, 66, 0.5);
}

/* 复选框标签对齐 */
.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-line span {
  line-height: 22px;
}

.download-file-item .file-label {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-file-item .file-size {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.download-actions {
  display: flex;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.download-actions .btn {
  flex: 1;
  min-height: 38px;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  min-height: 38px;
}

.btn-xs {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  min-height: 30px;
  line-height: 1;
}

/* 资源卡片定位 */
.resource-card {
  position: relative;
}

/* 上传进度条 */
.upload-progress-container {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
}

/* 下载进度条（用于多文件下载） */
.download-progress {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  padding: 16px;
  background: rgba(10, 22, 29, 0.95);
  border: 1px solid rgba(255, 140, 66, 0.3);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  z-index: 1000;
}

.download-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.download-progress-header .close-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
}

/* 资源操作按钮组 */
.resource-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.resource-actions .btn {
  flex: 1;
  min-width: fit-content;
}

/* 公告横幅 */
.announcements-banner {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.announcement-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.5;
}

.announcement-info {
  background: rgba(46, 183, 166, 0.15);
  border: 1px solid rgba(46, 183, 166, 0.3);
  color: #8cf5e7;
}

.announcement-warning {
  background: rgba(240, 178, 75, 0.15);
  border: 1px solid rgba(240, 178, 75, 0.3);
  color: #ffd699;
}

.announcement-danger {
  background: rgba(255, 91, 83, 0.15);
  border: 1px solid rgba(255, 91, 83, 0.3);
  color: #ffb2ae;
}

.announcement-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.announcement-text {
  flex: 1;
}

/* 公告弹窗 */
.announcement-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.announcement-modal.hidden {
  display: none;
}

.announcement-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.announcement-modal-content {
  position: relative;
  width: min(500px, 90vw);
  max-height: 80vh;
  background: linear-gradient(135deg, #0a1a22 0%, #0d1f29 100%);
  border: 1px solid rgba(255, 140, 66, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.announcement-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.announcement-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close-btn:hover {
  background: rgba(255, 91, 83, 0.3);
}

.announcement-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.announcement-modal-item {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.announcement-modal-item:last-child {
  margin-bottom: 0;
}

.announcement-modal-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.announcement-modal-item p {
  margin: 0;
  line-height: 1.7;
}

.announcement-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.dont-show-again {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
}

.dont-show-again input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* 后台统计面板 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-item {
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.stats-chart {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-chart h4 {
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  height: 100px;
  padding-bottom: 24px;
}

.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.chart-bar {
  width: 100%;
  min-height: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}

.chart-label {
  font-size: 0.7rem;
  color: var(--muted);
}

/* 公告管理 */
.announcements-list {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.announcements-list h4 {
  margin-bottom: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}

.announcement-item {
  padding: 14px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.announcement-item.disabled {
  opacity: 0.5;
}

.announcement-content {
  margin-bottom: 10px;
  line-height: 1.6;
}

.announcement-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 0.8rem;
}

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.badge-info {
  background: rgba(46, 183, 166, 0.2);
  color: var(--secondary);
}

.badge-warning {
  background: rgba(240, 178, 75, 0.2);
  color: #f0b24b;
}

.badge-danger {
  background: rgba(255, 91, 83, 0.2);
  color: var(--danger);
}

.announcement-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
}

.data-table td {
  font-size: 0.9rem;
}

.users-list {
  overflow-x: auto;
}

.user-name {
  font-weight: 500;
}

.muted {
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .shell,
  .auth-shell {
    width: min(100vw - 16px, 100%);
    padding-top: 12px;
  }

  .topbar,
  .hero-card,
  .panel-card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  /* 导航栏优化 */
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .topbar-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
  }

  .topbar-nav.active {
    display: flex;
  }

  .topbar-nav .btn {
    width: 100%;
    justify-content: center;
  }

  .topbar .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    min-height: 40px;
  }

  /* 减小标题字号 */
  .hero-card h2 {
    font-size: 1.2rem;
    line-height: 1.5;
  }

  .hero-card p {
    font-size: 0.9rem;
  }

  /* 统计卡片优化 */
  .portal-hero,
  .admin-hero {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    order: -1;
  }

  .stat-card {
    padding: 0.8rem 1rem;
  }

  .stat-card strong {
    font-size: 1.8rem;
  }

  /* 下拉菜单适配 */
  .stat-dropdown-menu {
    position: fixed;
    top: auto;
    left: 16px;
    right: 16px;
    margin-top: 8px;
    max-height: 60vh;
    overflow-y: auto;
  }

  /* 栏目卡片单列显示 */
  .category-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .category-card {
    padding: 16px;
  }

  .category-title {
    font-size: 1.1rem;
  }

  .category-description {
    font-size: 0.85rem;
  }

  .section-head {
    flex-direction: column;
    align-items: start;
    gap: 8px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: span 1;
  }

  /* 按钮触摸优化 */
  .btn {
    min-height: 44px;
    padding: 0.7rem 1.2rem;
  }

  /* 文件标签优化 */
  .file-label-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .file-label-size {
    font-size: 0.75rem;
  }

  /* 弹窗居中显示 */
  .download-options {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100vw - 32px);
    max-width: 320px;
    max-height: 70vh;
    overflow-y: auto;
  }

  /* 资源卡片优化 */
  .resource-card {
    padding: 12px;
  }

  /* 评论区域优化 */
  .comment-form textarea {
    min-height: 80px;
  }

  /* 底部栏优化 */
  footer {
    padding: 16px;
    font-size: 0.8rem;
  }
}

/* ==================== 主页精简样式 ==================== */

/* 栏目卡片网格 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.category-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.category-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 140, 66, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.category-index {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.category-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text);
}

.category-description {
  flex: 1;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.category-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.category-count {
  font-size: 0.85rem;
  color: var(--secondary);
  padding: 4px 12px;
  background: rgba(46, 183, 166, 0.1);
  border-radius: 999px;
}

.category-arrow {
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.2s;
}

.category-card:hover .category-arrow {
  transform: translateX(4px);
}

/* 栏目卡片带下拉统计 */
.category-card-with-stats {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
}

.category-card-with-stats:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 140, 66, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.category-card-with-stats .category-card {
  background: transparent;
  border: none;
  border-radius: 0;
}

.category-card-with-stats .category-card:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

/* 下拉统计区域 */
.category-dropdown-stats {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.dropdown-header:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.dropdown-toggle {
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.category-dropdown-stats:hover .dropdown-toggle {
  transform: rotate(180deg);
}

.dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.category-dropdown-stats:hover .dropdown-content {
  max-height: 300px;
  padding: 0 24px 16px;
}

.dropdown-content .stats-section {
  margin-bottom: 16px;
}

.dropdown-content .stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-content .stats-row:last-child {
  border-bottom: none;
}

.dropdown-content .stats-name {
  color: var(--muted);
  font-size: 0.85rem;
}

.dropdown-content .stats-num {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

.dropdown-content .empty-stats {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: 0.85rem;
}

.dropdown-content .recent-items {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dropdown-content .recent-title {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dropdown-content .recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.85rem;
  transition: all 0.2s;
}

.dropdown-content .recent-item:hover {
  background: rgba(255, 140, 66, 0.15);
}

.dropdown-content .recent-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 85%;
}

.dropdown-content .recent-type {
  font-size: 0.9rem;
}

/* 统计详情卡片 */
.stats-detail-card {
  margin-top: 24px;
}

.stats-list {
  display: grid;
  gap: 12px;
}

.stats-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.stats-label {
  color: var(--text);
  font-size: 0.95rem;
}

.stats-value {
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ==================== 用户管理样式 ==================== */

.user-card {
  padding: 20px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.user-actions {
  display: flex;
  gap: 10px;
}

.user-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  margin-bottom: 16px;
}

.user-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.detail-value {
  font-size: 0.95rem;
  color: var(--text);
  font-family: monospace;
}

/* 登录历史 */
.login-history {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-history h4 {
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  font-size: 0.85rem;
}

.history-time {
  color: var(--text);
  min-width: 160px;
}

.history-ip {
  color: var(--secondary);
  font-family: monospace;
  flex: 1;
}
