/* ===== 远辰网盘系统 - 全局样式 ===== */

:root {
  --primary:        #1a6fdf;
  --primary-dark:   #1358b5;
  --primary-light:  #e8f1fd;
  --accent:         #0ec9a0;
  --accent-dark:    #0ba888;
  --warn:           #f0892a;
  --danger:         #e63b3b;
  --danger-light:   #fdf0f0;
  --success:        #2db87a;
  --success-light:  #edfaf4;
  --text-main:      #1a1d2e;
  --text-sub:       #5a6172;
  --text-muted:     #9aa3b2;
  --border:         #e4e8ef;
  --border-light:   #f0f3f8;
  --bg:             #f4f6fb;
  --bg-card:        #ffffff;
  --bg-hover:       #f7f9fd;
  --sidebar-bg:     #141829;
  --sidebar-text:   #c4ccdf;
  --sidebar-active: #1a6fdf;
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --shadow-sm:      0 1px 4px rgba(26,111,223,.08);
  --shadow:         0 4px 18px rgba(26,111,223,.10);
  --shadow-lg:      0 10px 40px rgba(26,111,223,.14);
  --transition:     0.22s cubic-bezier(.4,0,.2,1);
  --font-main:      'Inter','PingFang SC','Microsoft YaHei',system-ui,sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 14px;
  scroll-behavior: smooth;
  margin: 0 !important;
  padding: 0 !important;
}

body {
  font-family: var(--font-main);
  color: var(--text-main);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0 !important;
  padding: 0 !important;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

button, .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  outline: none;
  font-family: var(--font-main);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,111,223,.28);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(26,111,223,.36); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14,201,160,.25);
}
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-main); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 2px 8px rgba(230,59,59,.20);
}
.btn-danger:hover { background: #cc2e2e; transform: translateY(-1px); }

.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 28px; font-size: 15px; border-radius: var(--radius); }
.btn-xl { height: 52px; padding: 0 36px; font-size: 16px; border-radius: var(--radius); }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; }
.btn-icon.btn-sm { width: 30px; height: 30px; }

/* ===== 表单控件 ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-main);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  font-family: var(--font-main);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,111,223,.12);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control.error { border-color: var(--danger); }
textarea.form-control { height: auto; padding: 10px 14px; resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}
.card-body { padding: 20px 24px; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== 徽章 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warn { background: #fff6ec; color: var(--warn); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-muted { background: #f0f2f5; color: var(--text-sub); }
.badge-accent { background: #e6faf6; color: var(--accent-dark); }

/* ===== 提示框 ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 3px solid transparent;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-light); border-color: var(--success); color: #1a7a52; }
.alert-warn { background: #fff6ec; border-color: var(--warn); color: #9a5a0a; }
.alert-danger { background: var(--danger-light); border-color: var(--danger); color: #a82222; }
.alert-info { background: var(--primary-light); border-color: var(--primary); color: #1358b5; }

/* ===== 表格 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--bg-hover); }
.data-table tr:last-child td { border-bottom: none; }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 16px 0;
  justify-content: center;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-sub);
  background: #fff;
  border: 1.5px solid var(--border);
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14,18,36,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.94) translateY(10px);
  transition: transform var(--transition);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  background: none; border: none; font-size: 18px;
}
.modal-close:hover { background: var(--bg); color: var(--text-main); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== 进度条 ===== */
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
}

/* ===== Toast通知 ===== */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0,0,0,.14);
  font-size: 13.5px;
  min-width: 240px;
  max-width: 360px;
  pointer-events: all;
  border-left: 3px solid var(--primary);
  animation: toast-in .28s ease forwards;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warn { border-color: var(--warn); }
.toast.out { animation: toast-out .22s ease forwards; }
.toast-icon { font-size: 16px; flex-shrink: 0; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(30px); }
}

/* ===== 页脚 ===== */
.site-footer {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  text-align: center;
  padding: 24px 20px;
  font-size: 12.5px;
  line-height: 2;
  margin-top: auto;
}
.site-footer a {
  color: #8a97b5;
  transition: color var(--transition);
}
.site-footer a:hover { color: #fff; }
.site-footer .footer-divider {
  display: inline-block;
  margin: 0 8px;
  color: #3a4060;
}

/* ===== 工具类 ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex-1 { flex: 1; }
.text-muted { color: var(--text-muted); }
.text-sub { color: var(--text-sub); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warn); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 600; }
.font-medium { font-weight: 500; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-full { width: 100%; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cdd2df; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aab2c6; }

/* ===== 选中高亮 ===== */
::selection { background: rgba(26,111,223,.15); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .modal { max-width: 96vw; }
  .data-table th, .data-table td { padding: 9px 10px; }
  .btn-lg { height: 40px; font-size: 14px; }
}
