/* ===== 立绘批量工作台 - 品牌设计系统 ===== */
/* Brand Prefix: sw (Standee Workbench) */
/* Theme: 翡翠绿 + 黑色底 */

:root {
  /* ---- Dark Theme (emerald green + black) ---- */
  --sw-background: #0a0a0a;
  --sw-foreground: #e8e8e8;
  --sw-card: #141414;
  --sw-card-foreground: #e8e8e8;
  --sw-popover: #1a1a1a;
  --sw-popover-foreground: #e8e8e8;
  --sw-primary: #00d68f;
  --sw-primary-foreground: #0a1410;
  --sw-muted: #6b6b6b;
  --sw-muted-foreground: #9e9e9e;
  --sw-border: rgba(255, 255, 255, 0.10);
  --sw-input: rgba(255, 255, 255, 0.06);
  --sw-ring: rgba(0, 214, 143, 0.35);
  --sw-radius-sm: 4px;
  --sw-radius-md: 8px;
  --sw-radius-lg: 12px;
  --sw-radius-full: 9999px;

  /* Accent colors */
  --sw-gold: #00d68f;
  --sw-gold-soft: rgba(0, 214, 143, 0.12);
  --sw-rose: #ff6b6b;

  /* State colors */
  --state-success: #00d68f;
  --state-warning: #ffb347;
  --state-error: #ff5252;
  --state-info: #5b9bd5;

  /* Typography */
  --sw-font-sans: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sw-font-mono: "Cascadia Code", "Fira Code", "Consolas", monospace;

  /* Shadows */
  --sw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --sw-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --sw-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);

  /* Gradient */
  --sw-brand-gradient: linear-gradient(135deg, #00d68f, #00b872);
  --sw-hero-gradient: radial-gradient(circle at 20% 10%, rgba(0, 214, 143, 0.15), transparent 40%),
    radial-gradient(circle at 80% 15%, rgba(0, 214, 143, 0.08), transparent 35%);
}

/* ---- Light Theme (emerald green + light gray) ---- */
.light-theme {
  --sw-background: #f5f5f5;
  --sw-foreground: #1a1a1a;
  --sw-card: #ffffff;
  --sw-card-foreground: #1a1a1a;
  --sw-popover: #ffffff;
  --sw-popover-foreground: #1a1a1a;
  --sw-primary: #00b872;
  --sw-primary-foreground: #ffffff;
  --sw-muted: #757575;
  --sw-muted-foreground: #5c5c5c;
  --sw-border: #e0e0e0;
  --sw-input: #fafafa;
  --sw-ring: rgba(0, 184, 114, 0.3);
  --sw-gold: #00b872;
  --sw-gold-soft: rgba(0, 184, 114, 0.08);
  --sw-rose: #e53935;
  --sw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --sw-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --sw-shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.08);
  --sw-hero-gradient: none;
}

/* ===== Global Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--sw-background);
  color: var(--sw-foreground);
  font-family: var(--sw-font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Typography Scale ===== */
h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

p {
  color: var(--sw-muted-foreground);
}

/* ===== Links ===== */
a {
  color: inherit;
  text-decoration: none;
}

/* ===== Buttons ===== */
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  border-radius: var(--sw-radius-md);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  transition: background 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
}

button:active {
  transform: scale(0.98);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  background: var(--sw-primary);
  color: var(--sw-primary-foreground);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--sw-input);
  color: var(--sw-foreground);
  border: 1px solid var(--sw-border);
}

.btn-secondary:hover {
  background: var(--sw-border);
}

.btn-danger {
  background: var(--state-error);
  color: #ffffff;
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-ghost {
  background: transparent;
  color: var(--sw-muted-foreground);
}

.btn-ghost:hover {
  background: var(--sw-input);
  color: var(--sw-foreground);
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  border-radius: var(--sw-radius-md);
}

/* ===== Forms ===== */
label {
  display: block;
  color: var(--sw-muted);
  font-size: 13px;
  font-weight: 600;
  margin: 14px 0 6px;
}

input[type="text"],
input[type="search"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--sw-border);
  background: var(--sw-input);
  color: var(--sw-foreground);
  border-radius: var(--sw-radius-md);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sw-primary);
  box-shadow: 0 0 0 3px var(--sw-ring);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

::placeholder {
  color: var(--sw-muted);
  opacity: 0.6;
}

/* ===== Panel / Card ===== */
.panel {
  background: var(--sw-card);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-lg);
  padding: 20px;
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-header p {
  font-size: 13px;
  line-height: 1.5;
  margin-top: 4px;
}

.panel-kicker {
  color: var(--sw-gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ===== Metric Cards ===== */
.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin: 14px 0;
}

.metric-card {
  background: var(--sw-input);
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius-md);
  padding: 16px;
}

.metric-card strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--sw-primary);
}

.metric-card span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  color: var(--sw-foreground);
}

.metric-card em {
  display: block;
  font-size: 12px;
  font-style: normal;
  color: var(--sw-muted);
  margin-top: 4px;
}

/* ===== Tags / Pills ===== */
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--sw-radius-full);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 10px;
  white-space: nowrap;
}

.status-pill.ok {
  background: rgba(0, 214, 143, 0.15);
  color: var(--state-success);
}

.status-pill.warn {
  background: var(--sw-gold-soft);
  color: var(--sw-gold);
}

.status-pill.danger {
  background: rgba(255, 82, 82, 0.12);
  color: var(--state-error);
}

/* ===== Empty State ===== */
.empty-state {
  background: var(--sw-input);
  border: 1px dashed var(--sw-border);
  border-radius: var(--sw-radius-md);
  color: var(--sw-muted);
  padding: 24px;
  text-align: center;
  font-size: 14px;
}

/* ===== Utility ===== */
.text-muted {
  color: var(--sw-muted);
}

.text-xs {
  font-size: 12px;
}

.text-sm {
  font-size: 13px;
}

.font-bold {
  font-weight: 700;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--sw-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--sw-muted);
}

/* ===== Shared icon mask helper ===== */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  background-color: currentColor;
}
