/* 第九假日 The Ninth Go — 全局样式（移动端自适应） */

:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #e3e6eb;
  --text: #1f2329;
  --muted: #6b7280;
  --primary: #2f6bff;
  --primary-dark: #1e56d6;
  --danger: #e5484d;
  --success: #1d9a56;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(20, 40, 80, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.container--wide {
  max-width: 1080px;
}

/* 顶部品牌 */
.brand {
  text-align: center;
  padding: 32px 0 24px;
}

.brand__name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand__sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.topnav {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.topnav a {
  font-size: 13px;
  color: var(--primary);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: #f0f1f3;
}

.btn--danger {
  background: var(--danger);
}

.btn--danger:hover {
  background: #c93c41;
}

.btn--sm {
  padding: 6px 10px;
  font-size: 13px;
}

/* 表单 */
label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.12);
}

.field {
  margin-bottom: 14px;
}

/* 拖拽上传区 */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--primary);
  background: rgba(47, 107, 255, 0.04);
}

.dropzone__icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.dropzone__hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

/* 进度条 */
.progress {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 16px 0;
}

.progress__bar {
  height: 100%;
  width: 0;
  background: var(--primary);
  transition: width 0.2s ease;
}

/* 结果卡片 */
.result__link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0f3ff;
  border: 1px solid #d8e2ff;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  margin: 12px 0;
}

.qr-wrap {
  text-align: center;
  margin: 16px 0;
}

.qr-wrap svg {
  width: 180px;
  height: 180px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* 提示 */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2329;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 999;
  max-width: 90vw;
}

.toast.is-show {
  opacity: 1;
}

/* 分享设置展开 */
.setting-toggle {
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  user-select: none;
}

.setting-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.hidden {
  display: none !important;
}

/* 预览页 */
.preview-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.preview-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.preview-box iframe {
  width: 100%;
  height: 70vh;
  border: 0;
  display: block;
}

.preview-box img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}

.preview-box video,
.preview-box audio {
  display: block;
  width: 100%;
}

.preview-box pre {
  margin: 0;
  padding: 16px;
  overflow: auto;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
  background: #fafbfc;
}

.error-state {
  text-align: center;
  padding: 40px 16px;
}

.error-state__icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.error-state__title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.error-state__desc {
  color: var(--muted);
  font-size: 14px;
}

/* 管理后台表格 */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

td .filename {
  font-weight: 600;
  word-break: break-all;
}

td .muted {
  color: var(--muted);
}

.note-input {
  font-size: 13px;
  padding: 6px 8px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: #eef1f6;
  color: #495057;
}

.badge--warn {
  background: #fff3e0;
  color: #b45309;
}

@media (max-width: 640px) {
  .container {
    padding: 16px 12px 40px;
  }
  .brand {
    padding: 20px 0 16px;
  }
  .dropzone {
    padding: 32px 16px;
  }
}
