@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-page: #e6f3fa;
  --bg-card: #fffef8;
  --bg-subtle: #f5fafd;
  --bg-hover: #f0f8fc;
  --border: #cfe3f0;
  --border-light: #dceaf3;
  --text-primary: #2d3748;
  --text-secondary: #5a6a7e;
  --text-muted: #8a9bb0;
  --accent: #1a8cff;
  --accent-hover: #1470d4;
  --accent-soft: #e8f3fc;
  --accent-ring: rgba(26, 140, 255, 0.18);
  --success: #2d8a62;
  --danger: #c4454d;
  --warning: #b07d1a;
  --info: #3a7ca5;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 4px rgba(26, 60, 90, 0.06);
  --shadow: 0 4px 18px rgba(26, 60, 90, 0.08);
  --nav-height: 44px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100dvh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  transition: color var(--transition);
}

a:hover, a:focus {
  color: var(--accent-hover);
  text-decoration: none;
}

/* ── Navbar（高度缩减 1/3）── */
.navbar-default {
  background: var(--bg-card);
  border: none;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
  min-height: var(--nav-height);
}

.navbar-default .container {
  min-height: var(--nav-height);
}

.navbar-default .navbar-brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  color: var(--text-primary) !important;
  padding: 10px 15px;
  height: var(--nav-height);
  line-height: 24px;
  display: flex;
  align-items: center;
}

.navbar-default .navbar-brand:hover {
  color: var(--accent) !important;
}

.site-logo {
  max-height: 32px;
  width: auto;
  max-width: 200px;
  height: auto;
  display: block;
  object-fit: contain;
}

.navbar-default .navbar-nav > li > a {
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 13px;
  padding: 12px 12px;
  transition: color var(--transition);
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
  color: var(--accent) !important;
  background: transparent !important;
}

.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
  border-radius: var(--radius-sm);
}

.navbar-default .navbar-toggle {
  border-color: var(--border);
  margin-top: 6px;
  margin-bottom: 6px;
  padding: 7px 10px;
}

.navbar-default .navbar-toggle .icon-bar {
  background-color: var(--text-secondary);
}

.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
  background: var(--bg-hover);
}

.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 4px 0;
  font-size: 13px;
}

.dropdown-menu > li > a {
  color: var(--text-secondary) !important;
  padding: 7px 16px;
}

.dropdown-menu > li > a:hover {
  background: var(--bg-hover) !important;
  color: var(--accent) !important;
}

/* ── Layout ── */
.container {
  max-width: 1140px;
  padding-top: 28px;
  padding-bottom: 40px;
}

.well, .bs-component .well {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px 28px;
  margin-bottom: 20px;
}

.well h2, .well h3, .well h4 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 0;
}

.well .text-muted, .text-muted {
  color: var(--text-muted) !important;
}

/* ── Tables ── */
.table {
  color: var(--text-primary);
  background: transparent;
}

.table > thead > tr > th {
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 10px;
  background: var(--bg-hover);
}

.table > tbody > tr > td {
  border-top: 1px solid var(--border-light);
  padding: 10px;
  vertical-align: middle;
  font-size: 14px;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background: var(--bg-subtle);
}

.table-hover > tbody > tr:hover {
  background: var(--accent-soft);
}

.table > tbody > tr > td a.btn { margin: 1px; }

.filelist > tbody > tr > td {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Forms ── */
.form-control {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  height: auto;
  box-shadow: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  color: var(--text-primary);
}

.form-control::placeholder { color: var(--text-muted); }

.form-group label, .form-group label.control-label {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 5px;
}

.form-group { padding-bottom: 0; margin: 0 0 14px 0; }
.checkbox label, .radio label { color: var(--text-secondary); }

/* ── Buttons ── */
.btn {
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform 0.15s ease;
}

.btn-primary, .btn-raised.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  box-shadow: none;
}

.btn-primary:hover, .btn-primary:focus,
.btn-raised.btn-primary:hover, .btn-raised.btn-primary:focus {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-primary:active { transform: scale(0.98); }

.btn-default, .btn-raised.btn-default {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-default:hover, .btn-default:focus {
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-info { background: var(--info); border-color: var(--info); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }

.btn-tech { padding: 11px 22px; font-size: 15px; }

.btn-tech-outline {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--accent);
}

.btn-tech-outline:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.btn-xs { font-size: 12px; padding: 3px 8px; }

/* ── Nav Tabs ── */
.nav-tabs {
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.nav-tabs > li > a {
  color: var(--text-muted) !important;
  border: none !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
  margin-right: 2px;
  padding: 9px 16px;
  font-weight: 500;
  font-size: 14px;
}

.nav-tabs > li > a:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  background: transparent !important;
  color: var(--accent) !important;
  border-bottom: 2px solid var(--accent) !important;
}

/* ── Alerts ── */
.alert { border-radius: var(--radius-sm); border: 1px solid; }
.alert-info { background: var(--accent-soft); border-color: #b8d9f0; color: var(--accent-hover); }
.alert-success { background: #edf7f1; border-color: #b8dfc8; color: var(--success); }
.alert-warning { background: #fdf6e8; border-color: #ecd9a8; color: var(--warning); }
.alert-danger { background: #fdf0f1; border-color: #e8b8bc; color: var(--danger); }

/* ── Progress ── */
.progress { height: 8px; background: var(--border-light); border-radius: 4px; margin-bottom: 10px; overflow: hidden; }
.progress-bar { background: var(--accent); border-radius: 4px; font-size: 0; }

/* ── Pagination ── */
.pagination > li > a, .pagination > li > span {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-secondary);
}

.pagination > li > a:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

.pagination > .active > a, .pagination > .active > a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Footer（高度缩减 2/5）── */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 14px 0;
  margin-top: 24px;
}

.footer .text-muted {
  color: var(--text-muted) !important;
  font-size: 12px;
  margin: 0;
  line-height: 1.5;
}

.footer .container { padding-top: 0; padding-bottom: 0; }

/* ── Auth Page ── */
.auth-page {
  padding-top: 40px;
  padding-bottom: 60px;
  min-height: calc(100dvh - 100px);
  display: flex;
  align-items: center;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-card-header { padding: 24px 28px 0; text-align: center; }

.auth-card-header h4 {
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  color: var(--text-primary);
}

.auth-tabs { padding: 0 20px; margin-top: 20px; }
.auth-tab-content { padding: 20px 28px 30px; }

.auth-form .form-group label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.auth-modal .modal-content, .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  box-shadow: var(--shadow);
}

.auth-modal .modal-header, .modal-header { border-bottom: 1px solid var(--border-light); }
.auth-modal .modal-footer, .modal-footer { border-top: 1px solid var(--border-light); }
.auth-modal .close, .modal-header .close { color: var(--text-muted); opacity: 0.8; }

.captcha-modal-center.in {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}

.captcha-modal-center .modal-dialog {
  margin: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
}

.oauth-section .loginbtn {
  margin: 10px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}

.oauth-section .loginbtn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

#loginform .loginbtn { margin: 12px; }
.loginbtn i { padding-top: 0; font-size: 20px; }

/* ── Upload Page ── */
.infobox {
  text-align: center;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#uploadTitle {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 17px !important;
}

.filename {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── File View ── */
.view { padding-top: 60px; padding-bottom: 60px; }
.elsetext { top: 0; color: var(--text-muted); font-size: 20px; }
.elseview { height: 150px; }
.tubiao { background-color: transparent; font-size: 100px; color: var(--text-muted); width: 100px; height: 100px; }
.video_view, .image_view, .image { border-radius: var(--radius-sm); }
.video_view { width: 100%; max-height: 450px; min-height: 300px; }
.image_view { max-width: 100%; max-height: 450px; min-height: 300px; }
.image { max-width: 100%; max-height: 450px; }
.fileinfo-table { max-width: 80%; }
@media (max-width: 767px) { .fileinfo-table { max-width: 100%; } }

/* ── Search ── */
.searchbox { margin-top: -8px; }
.searchbox button { margin-top: 6px; }
@media (min-width: 767px) { .searchbox { float: right; } }

.form-inline .form-control { display: inline-block; width: auto; vertical-align: middle; }
.form-inline .form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; }

/* ── Player ── */
.aplayer {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-sm) !important;
}

.aplayer .aplayer-pic { height: 100px; width: 100px; }
.aplayer .aplayer-info .aplayer-music .aplayer-title { font-size: 18px; }
.aplayer .aplayer-info { margin-left: 100px; padding: 25px 7px 0 10px; height: 66px; box-sizing: border-box; }

/* ── Video ── */
.videoplayer { width: 100%; height: 530px; border-radius: var(--radius-sm); }
@media (max-width: 1999px) { .videoplayer { height: 500px; } }
@media (max-width: 991px) { .videoplayer { height: 450px; } }
@media (max-width: 767px) { .videoplayer { height: 400px; } }

/* ── Input Group ── */
.input-group-addon {
  background: var(--bg-hover);
  border-color: var(--border);
  color: var(--text-secondary);
}

/* ── Loading ── */
@-webkit-keyframes stretchdelay {
  0%, 100%, 40% { -webkit-transform: scaleY(0.4); }
  20% { -webkit-transform: scaleY(1); }
}
@keyframes stretchdelay {
  0%, 100%, 40% { transform: scaleY(0.4); }
  20% { transform: scaleY(1); }
}

.colorful_loading_frame {
  position: fixed;
  top: 0; left: 0;
  z-index: 99999;
  width: 100%; height: 100%;
  background: rgba(230, 243, 250, 0.9);
  color: var(--accent);
  text-align: center;
  font-size: 2em;
}

.colorful_loading {
  margin: 25% auto;
  width: 50px; height: 60px;
  text-align: center;
  font-size: 10px;
}

.colorful_loading > i {
  display: inline-block;
  margin-right: 3px;
  width: 6px; height: 100%;
  background-color: var(--accent);
  -webkit-animation: stretchdelay 1.2s infinite ease-in-out;
  animation: stretchdelay 1.2s infinite ease-in-out;
}

.colorful_loading .rect2 { animation-delay: -1.1s; }
.colorful_loading .rect3 { animation-delay: -1s; }
.colorful_loading .rect4 { animation-delay: -0.9s; }
.colorful_loading .rect5 { animation-delay: -0.8s; }

/* ── Focus ── */
a:focus, button:focus, .btn:focus, .form-control:focus {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .well, .bs-component .well { padding: 18px 14px; }
  .auth-tab-content { padding: 16px 14px 22px; }
  .auth-card-header { padding: 20px 14px 0; }
  .container { padding-top: 16px; }
}
