/* yfcserver.top — shared UI (portal / test / file gate) */
:root {
  --bg0: #0f1419;
  --bg1: #1a222c;
  --bg2: #243040;
  --card: #1e2833;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8eef4;
  --muted: #8b9aab;
  --accent: #3d9cf0;
  --accent2: #2dd4a8;
  --danger: #f07178;
  --ok: #7fd962;
  --radius: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.yfc-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 156, 240, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(45, 212, 168, 0.12), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #121820);
  line-height: 1.5;
}

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

.yfc-wrap {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.yfc-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.yfc-brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}
.yfc-brand span { color: var(--accent2); }
.yfc-brand:hover { text-decoration: none; opacity: 0.92; }

.yfc-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.yfc-nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
}
.yfc-nav-links a:hover,
.yfc-nav-links a.is-active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.yfc-hero {
  margin-bottom: 1.75rem;
}
.yfc-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.yfc-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

.yfc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.yfc-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.yfc-card:hover {
  transform: translateY(-2px);
  border-color: rgba(61, 156, 240, 0.45);
  background: #243140;
  text-decoration: none;
}
.yfc-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.yfc-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.yfc-card .tag {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.72rem;
  color: var(--accent2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.yfc-section {
  margin-top: 2rem;
}
.yfc-section h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.yfc-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}

.yfc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.yfc-list a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  text-decoration: none;
}
.yfc-list a:hover {
  border-color: var(--line);
  background: rgba(61, 156, 240, 0.08);
}

.yfc-muted { color: var(--muted); font-size: 0.9rem; }
.yfc-foot {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

/* forms / buttons shared by login + upload chrome */
.yfc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  border: none;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.yfc-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.yfc-btn-primary { background: var(--accent); color: #041018; font-weight: 600; }
.yfc-btn-primary:hover:not(:disabled) { background: #5aaff5; text-decoration: none; }
.yfc-btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.yfc-btn-ghost:hover:not(:disabled) { color: var(--text); border-color: rgba(255,255,255,0.2); text-decoration: none; }

.yfc-field { margin-bottom: 1rem; }
.yfc-field label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.yfc-field input[type="password"],
.yfc-field input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg0);
  color: var(--text);
  font: inherit;
}
.yfc-field input:focus {
  outline: 2px solid rgba(61, 156, 240, 0.45);
  border-color: var(--accent);
}

.yfc-alert {
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.yfc-alert-err {
  background: rgba(240, 113, 120, 0.12);
  color: #ffb4b8;
  border: 1px solid rgba(240, 113, 120, 0.35);
}

.yfc-login-card {
  width: min(400px, 100%);
  margin: 12vh auto 0;
}
.yfc-wrap.yfc-wrap-login {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.yfc-wrap.yfc-wrap-login .yfc-nav {
  width: 100%;
}
.yfc-wrap.yfc-wrap-login .yfc-login-card {
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 560px) {
  .yfc-wrap { width: calc(100% - 1.25rem); padding-top: 1.25rem; }
}


/* ===== unified page extras (dark portal) ===== */
.yfc-nav { margin-bottom: 1.25rem; }

.yfc-page-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.yfc-page-sub {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 46rem;
}
.yfc-page-sub strong { color: var(--text); font-weight: 600; }

.yfc-flist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.yfc-flist li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.85rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.yfc-flist li:last-child { border-bottom: 0; }
.yfc-flist a {
  color: var(--accent2);
  font-weight: 600;
  word-break: break-all;
  text-decoration: none;
}
.yfc-flist a:hover { text-decoration: underline; color: #5ee4c0; }
.yfc-flist .meta { color: var(--muted); font-size: 0.8rem; }

.yfc-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.yfc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.yfc-table th,
.yfc-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.yfc-table th {
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.yfc-table tr:last-child td { border-bottom: 0; }
.yfc-table a { color: var(--accent); font-weight: 600; }
.yfc-table .dim { color: var(--muted); font-size: 0.85rem; }

/* upload form (dark) — body.yfc-body .yfc-upload for specificity */
body.yfc-body .yfc-upload .actions-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-bottom: 12px;
}
body.yfc-body .yfc-upload .upload-area {
  border: 2px dashed rgba(255,255,255,0.22);
  border-radius: var(--radius);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 16px;
  color: var(--muted);
  background: rgba(0,0,0,0.15);
}
body.yfc-body .yfc-upload .upload-area strong { color: var(--text); }
body.yfc-body .yfc-upload .upload-area:hover,
body.yfc-body .yfc-upload .upload-area.dragover {
  border-color: var(--accent2);
  background: rgba(45, 212, 168, 0.1);
}
body.yfc-body .yfc-upload input.hidden-input,
body.yfc-body .yfc-upload .hidden-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  display: none !important;
}
body.yfc-body .yfc-upload button,
body.yfc-body .yfc-upload .btn-link {
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s, border-color 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #041018;
}
body.yfc-body .yfc-upload button.primary {
  background: var(--accent2); color: #041018; font-weight: 600;
}
body.yfc-body .yfc-upload button.primary:hover:not(:disabled) { background: #5ee4c0; }
body.yfc-body .yfc-upload button.secondary,
body.yfc-body .yfc-upload a.btn-link {
  background: var(--accent); color: #041018; font-weight: 600;
}
body.yfc-body .yfc-upload button.secondary:hover:not(:disabled),
body.yfc-body .yfc-upload a.btn-link:hover { background: #5aaff5; text-decoration: none; }
body.yfc-body .yfc-upload button.ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line);
}
body.yfc-body .yfc-upload button.ghost:hover:not(:disabled) {
  color: var(--text); border-color: rgba(255,255,255,0.28);
}
body.yfc-body .yfc-upload button:disabled { opacity: 0.45; cursor: not-allowed; }
body.yfc-body .yfc-upload .toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px;
}
body.yfc-body .yfc-upload .queue-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  max-height: 420px;
  overflow-y: auto;
  background: rgba(0,0,0,0.25);
}
body.yfc-body .yfc-upload .queue-head {
  display: grid;
  grid-template-columns: 1fr 100px 88px;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  position: sticky; top: 0; z-index: 1;
}
body.yfc-body .yfc-upload .queue-row {
  display: grid;
  grid-template-columns: 1fr 100px 88px;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  align-items: center;
  color: var(--text);
}
@media (max-width: 600px) {
  body.yfc-body .yfc-upload .queue-head { display: none; }
  body.yfc-body .yfc-upload .queue-row { grid-template-columns: 1fr; }
}
body.yfc-body .yfc-upload .path-cell { word-break: break-all; line-height: 1.4; }
body.yfc-body .yfc-upload .path-cell .name { font-weight: 500; color: var(--text); }
body.yfc-body .yfc-upload .path-cell .rel { color: var(--muted); font-size: 12px; }
body.yfc-body .yfc-upload .summary {
  text-align: center; color: var(--muted); margin-bottom: 12px; font-size: 0.9rem;
}
body.yfc-body .yfc-upload .message {
  padding: 0.75rem 0.9rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem;
}
body.yfc-body .yfc-upload .message.ok,
body.yfc-body .yfc-upload .message.success {
  background: rgba(127, 217, 98, 0.12); color: #b6f0a0;
  border: 1px solid rgba(127, 217, 98, 0.35);
}
body.yfc-body .yfc-upload .message.err,
body.yfc-body .yfc-upload .message.error {
  background: rgba(240, 113, 120, 0.12); color: #ffb4b8;
  border: 1px solid rgba(240, 113, 120, 0.35);
}
body.yfc-body .yfc-upload .row-progress-bar {
  height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; margin-top: 4px;
}
body.yfc-body .yfc-upload .row-progress-bar > span {
  display: block; height: 100%; background: var(--accent2); width: 0%;
}
body.yfc-body .yfc-upload .allowed-types {
  margin-top: 1rem; color: var(--muted); font-size: 0.82rem; line-height: 1.5;
}
body.yfc-body .yfc-upload .allowed-types strong { color: var(--text); }

/* ===== show_file dark (override old light inline CSS) ===== */
body.yfc-body.yfc-files {
  padding: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  /* 必须保留门户暗色底；勿用 transparent，否则会盖掉 .yfc-body 渐变 */
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 156, 240, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(45, 212, 168, 0.12), transparent 50%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #121820) !important;
  color: var(--text) !important;
  font-family: var(--font) !important;
  line-height: 1.6;
}
body.yfc-body.yfc-files .header {
  border-bottom: 1px solid var(--line) !important;
  margin-bottom: 1.25rem !important;
  padding-bottom: 0.85rem !important;
}
body.yfc-body.yfc-files .header h1 {
  color: var(--text) !important;
  font-size: 1.5rem !important;
  font-family: var(--font) !important;
}
body.yfc-body.yfc-files .upload-link {
  background: var(--accent2) !important;
  color: #041018 !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
}
body.yfc-body.yfc-files .upload-link:hover { background: #5ee4c0 !important; }
body.yfc-body.yfc-files .btn-secondary {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
}
body.yfc-body.yfc-files .message.success {
  background: rgba(127, 217, 98, 0.12) !important;
  color: #b6f0a0 !important;
  border: 1px solid rgba(127, 217, 98, 0.35) !important;
}
body.yfc-body.yfc-files .message.error {
  background: rgba(240, 113, 120, 0.12) !important;
  color: #ffb4b8 !important;
  border: 1px solid rgba(240, 113, 120, 0.35) !important;
}
body.yfc-body.yfc-files .toolbar { gap: 10px; }
body.yfc-body.yfc-files .search-wrap input,
body.yfc-body.yfc-files input[type="search"],
body.yfc-body.yfc-files input[type="text"] {
  background: var(--bg0) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
}
body.yfc-body.yfc-files .search-hint { color: var(--muted) !important; }
body.yfc-body.yfc-files .file-tree-container,
body.yfc-body.yfc-files .file-tree,
body.yfc-body.yfc-files .file-tree ul {
  background: var(--card) !important;
  background-color: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
body.yfc-body.yfc-files .file-tree-container {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  padding: 0.5rem !important;
}
body.yfc-body.yfc-files .file-item,
body.yfc-body.yfc-files .directory-item {
  background: rgba(255,255,255,0.03) !important;
  background-color: rgba(255,255,255,0.03) !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  color: var(--text) !important;
}
body.yfc-body.yfc-files .file-item:hover,
body.yfc-body.yfc-files .directory-item:hover,
body.yfc-body.yfc-files .directory-row:hover {
  background: rgba(61, 156, 240, 0.1) !important;
  background-color: rgba(61, 156, 240, 0.1) !important;
}
body.yfc-body.yfc-files .item-name,
body.yfc-body.yfc-files .item-info { color: var(--text) !important; }
body.yfc-body.yfc-files .item-meta { color: var(--muted) !important; }
body.yfc-body.yfc-files .folder-icon { color: #e8c36a !important; }
body.yfc-body.yfc-files .file-icon { color: var(--accent) !important; }
body.yfc-body.yfc-files .chevron { color: var(--muted) !important; }
body.yfc-body.yfc-files .copy-btn {
  background: rgba(61,156,240,0.15) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(61,156,240,0.35) !important;
}
body.yfc-body.yfc-files .download-btn {
  background: rgba(45,212,168,0.15) !important;
  color: var(--accent2) !important;
  border: 1px solid rgba(45,212,168,0.35) !important;
}
body.yfc-body.yfc-files .delete-btn {
  background: rgba(240,113,120,0.12) !important;
  color: #ffb4b8 !important;
  border: 1px solid rgba(240,113,120,0.35) !important;
}
body.yfc-body.yfc-files .modal-overlay { background: rgba(0,0,0,0.7) !important; }
body.yfc-body.yfc-files .modal {
  background: var(--card) !important;
  background-color: var(--card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
}
body.yfc-body.yfc-files .modal-btn.cancel {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--line) !important;
}
body.yfc-body.yfc-files .modal-btn.confirm {
  background: var(--danger) !important;
  color: #fff !important;
  border: none !important;
}
body.yfc-body.yfc-files .toast {
  background: var(--bg2) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
}
