:root {
  --bg: #f4f7ff;
  --panel: #ffffff;
  --line: #e5e9f2;
  --text: #1f2937;
  --sub-text: #64748b;
  --primary: #2563eb;
  --danger: #dc2626;
  --success: #16a34a;
  --warn: #d97706;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f6fc 100%);
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 36px;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
}

.page-header p {
  margin: 8px 0 0;
  color: var(--sub-text);
}

.global-search-bar {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.global-search-bar input {
  flex: 1;
  min-width: 240px;
  padding: 12px 14px;
  border: 1px solid #93c5fd;
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.global-search-bar input:focus {
  border-color: #2563eb;
  outline: none;
}

.result-group-title {
  margin: 18px 0 10px;
  font-size: 16px;
  color: #334155;
}

.result-group-title:first-of-type {
  margin-top: 0;
}

.panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.panel-title-row h2 {
  margin: 0;
  font-size: 20px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: #334155;
}

.hint {
  font-size: 12px;
  color: var(--sub-text);
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  font-size: 14px;
}

.filter-select {
  width: auto;
  min-width: 140px;
}

input:focus,
select:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
  display: flex;
  gap: 10px;
}

button {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover:not(:disabled) {
  background: #1d4ed8;
}

.ghost-btn {
  background: #fff;
  color: #1e293b;
  border-color: #cbd5e1;
}

.ghost-btn:hover {
  background: #f8fafc;
}

.stats {
  font-size: 13px;
  color: var(--sub-text);
  margin-bottom: 10px;
}

.warn-text {
  color: var(--warn);
}

.feedback-form {
  display: grid;
  gap: 12px;
}

.feedback-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.feedback-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px 14px;
}

.feedback-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-note {
  margin-top: 12px;
  margin-bottom: 0;
}

.main-tabs {
  display: flex;
  gap: 10px;
  margin: 16px 0 0;
  flex-wrap: wrap;
}

.main-tab {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.main-tab.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.search-link-row {
  flex-wrap: wrap;
}

.search-link-row input {
  min-width: 220px;
  flex: 1;
}

.link-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.link-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 200px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.link-item:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.link-item-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.link-item-icon-inline {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.link-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #eef2ff;
  flex-shrink: 0;
}

.link-item-main {
  flex: 1;
  min-width: 0;
}

.link-desc {
  margin: 6px 0 0;
  color: #334155;
  font-size: 14px;
  line-height: 1.5;
}

.link-url-preview {
  margin: 6px 0 0;
  color: #2563eb;
  font-size: 12px;
  word-break: break-all;
  opacity: 0.9;
}

.badge-link {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #3730a3;
  border-color: #a5b4fc;
}

.link-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}

.link-priority-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #93c5fd;
}

.priority-order-btn {
  min-width: 64px;
  padding: 4px 10px;
  font-size: 12px;
}

.priority-order-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.link-open-btn {
  background: #7c3aed;
}

.link-open-btn:hover {
  background: #6d28d9;
}

.copy-link-btn {
  min-width: 96px;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.file-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 200px;
  background: #fff;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.file-item:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.file-head {
  display: block;
  flex: 1;
}

.file-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.software-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #eff6ff;
  flex-shrink: 0;
}

.file-main {
  flex: 1;
  min-width: 0;
}

.file-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.file-title {
  margin: 0;
  font-size: 17px;
}

.file-desc {
  margin: 6px 0 0;
  color: var(--sub-text);
  font-size: 13px;
}

.badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #e0ecff;
  color: #1d4ed8;
  white-space: nowrap;
}

.badge-front {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border: 1px solid #93c5fd;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
  flex-shrink: 0;
}

.badge-icon {
  font-size: 15px;
  line-height: 1;
}

.icon-input {
  max-width: 120px;
  font-size: 20px;
  text-align: center;
}

.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
}

.icon-option {
  width: 38px;
  height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.icon-option:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  transform: translateY(-1px);
}

.icon-option.active {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.file-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.download-link {
  text-decoration: none;
  color: #fff;
  background: var(--success);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.download-link:hover {
  background: #15803d;
}

.delete-btn {
  border-color: #fecaca;
  background: #fff1f2;
  color: var(--danger);
  font-size: 13px;
  padding: 6px 10px;
}

.delete-btn:hover {
  background: #ffe4e6;
}

.empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: var(--sub-text);
  text-align: center;
  grid-column: 1 / -1;
}

.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tab-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}

.tab-btn.active {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.progress-wrap {
  display: grid;
  gap: 6px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  transition: width 0.2s ease;
}

.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.health-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fafc;
}

.health-item h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.health-item p {
  margin: 0;
  font-size: 12px;
  color: var(--sub-text);
  line-height: 1.5;
}

.health-item.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.health-item.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #16a34a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
  z-index: 1000;
}

.toast.toast-error {
  background: #dc2626;
}

.hidden {
  display: none !important;
}

.category-form {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

.category-list {
  display: grid;
  gap: 8px;
}

.category-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.category-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-item-title {
  margin: 0;
  font-size: 15px;
}

.category-item-meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--sub-text);
}

@media (max-width: 700px) {
  .file-list,
  .link-list {
    grid-template-columns: 1fr;
  }

  .file-actions,
  .panel-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-select {
    width: 100%;
  }
}

.super-entry-tab {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fdba74;
  color: #9a3412;
}

.super-entry-tab:hover {
  border-color: #f97316;
}

.super-simple-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
}

.super-subtitle {
  margin: 20px 0 8px;
  font-size: 16px;
  color: #334155;
}

.super-tool-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.super-tool-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  flex-wrap: wrap;
}

.super-tool-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.super-admin-panel {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
}

.password-dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.password-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.password-dialog form {
  padding: 20px;
}

.password-dialog h3 {
  margin: 0 0 8px;
}

.super-password-once {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  font-size: 20px;
  letter-spacing: 2px;
  font-family: Consolas, "Courier New", monospace;
  word-break: break-all;
}

.warn-text {
  color: var(--warn);
}
