/* Apple-like minimal UI — system fonts, neutral surfaces */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #86868b;
  --border: rgba(0, 0, 0, 0.06);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --danger: #ff3b30;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  color: var(--text);
  background: var(--bg);
}

/* 全站背景图：由 body.has-site-bg 上 --site-bg-image 提供 URL */
body.has-site-bg {
  background-color: var(--bg);
}

body.has-site-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--site-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.has-site-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(245, 245, 247, 0.66);
  backdrop-filter: saturate(150%) blur(12px);
}

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

a:hover {
  text-decoration: underline;
}

.apple-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 32px;
}

.apple-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.apple-card--wide {
  max-width: 920px;
}

.apple-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 32px 16px;
  border-bottom: 1px solid var(--border);
}

.apple-tab {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.apple-tab:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.apple-tab.is-active {
  background: rgba(0, 113, 227, 0.12);
  color: var(--accent);
}

.apple-panel {
  display: none;
}

.apple-panel.is-active {
  display: block;
}

.apple-hero {
  padding: 40px 32px 12px;
  text-align: center;
}

.apple-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.apple-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.apple-sub {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.apple-body {
  padding: 8px 32px 36px;
}

.apple-field {
  margin-bottom: 20px;
}

.apple-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.apple-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafafa;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.apple-input:focus {
  border-color: rgba(0, 113, 227, 0.45);
  background: var(--surface);
}

.apple-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  font-size: 17px;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.apple-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

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

.apple-btn--ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(0, 113, 227, 0.35);
}

.apple-btn--ghost:hover:not(:disabled) {
  background: rgba(0, 113, 227, 0.06);
}

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

.apple-brand-logo {
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.apple-brand-logo--toolbar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.apple-brand-logo--hero {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto 16px;
}

.apple-toolbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.apple-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.apple-toolbar a,
.apple-toolbar button {
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
}

.apple-toolbar button:hover,
.apple-toolbar a:hover {
  background: rgba(0, 113, 227, 0.08);
  text-decoration: none;
}

.apple-msg {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
}

.apple-msg--error {
  background: rgba(255, 59, 48, 0.08);
  color: #c41e16;
}

.apple-msg--ok {
  background: rgba(52, 199, 89, 0.12);
  color: #1f7a3d;
}

.apple-compliance {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-secondary);
  text-align: left;
}

.apple-compliance p {
  margin: 0;
}

.apple-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.apple-table-wrap {
  overflow-x: auto;
  padding: 0 0 24px;
}

.apple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.apple-table th,
.apple-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.apple-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: #fafafa;
}

.apple-table td {
  vertical-align: top;
  word-break: break-all;
}

.apple-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  background: #f0f0f2;
  padding: 4px 8px;
  border-radius: 6px;
}

.apple-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.apple-actions button {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: #f0f0f2;
  color: var(--text);
}

.apple-actions button:hover {
  background: #e8e8ed;
}

.apple-actions button[data-del] {
  color: var(--danger);
}

.apple-actions button.apple-btn-approve {
  background: rgba(0, 113, 227, 0.14);
  color: var(--accent);
}

.apple-actions button.apple-btn-approve:hover {
  background: rgba(0, 113, 227, 0.22);
}

.apple-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.apple-modal-backdrop.is-open {
  display: flex;
}

.apple-modal {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 24px 24px;
}

.apple-modal h3 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
}

.apple-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.apple-modal-actions .apple-btn {
  width: auto;
  flex: 1;
}

.apple-modal--wide {
  max-width: 440px;
}

.apple-result-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-all;
  color: var(--text);
}

.apple-result-text--accent {
  font-weight: 500;
  color: var(--accent);
}

select.apple-input {
  appearance: auto;
}

.apple-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
  font-size: 15px;
}

@media (max-width: 640px) {
  .apple-title {
    font-size: 24px;
  }
  .apple-hero {
    padding: 32px 24px 8px;
  }
  .apple-body {
    padding: 8px 24px 28px;
  }
}
