/** app.wxss - xAI Brutalist Design System */

page {
  --bg-dark: #1f2228;
  --bg-surface: rgba(255, 255, 255, 0.03);
  --bg-hover: rgba(255, 255, 255, 0.08);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-disabled: rgba(255, 255, 255, 0.3);

  --border-default: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);

  --focus-ring: rgb(59, 130, 246);

  --radius-none: 0rpx;
  --radius-subtle: 8rpx;

  --spacing-xs: 8rpx;
  --spacing-sm: 16rpx;
  --spacing-md: 24rpx;
  --spacing-lg: 48rpx;
  --spacing-xl: 96rpx;

  min-height: 100%;
  color: var(--text-primary);
  font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  background: var(--bg-dark);
}

.container {
  position: relative;
  padding: var(--spacing-md);
  padding-bottom: calc(var(--spacing-lg) + env(safe-area-inset-bottom));
}

/* Hero Section */
.hero {
  position: relative;
  padding: var(--spacing-lg) 0;
  text-align: center;
  border-bottom: 1px solid var(--border-default);
}

.hero-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 22rpx;
  letter-spacing: 1rpx;
  text-transform: uppercase;
}

.hero-title {
  margin-top: var(--spacing-md);
  font-size: 56rpx;
  font-weight: 300;
  letter-spacing: 2rpx;
  color: var(--text-primary);
  line-height: 1.3;
}

.hero-sub {
  margin-top: var(--spacing-sm);
  font-size: 28rpx;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 600rpx;
  margin-left: auto;
  margin-right: auto;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-md);
}

.hero-metric {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 24rpx;
  color: var(--text-muted);
  border: 1px solid var(--border-default);
}

/* Cards */
.card {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: transparent;
  border: 1px solid var(--border-default);
  overflow: hidden;
}

.card:active {
  border-color: var(--border-strong);
}

.card-title {
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
  font-size: 32rpx;
  font-weight: 400;
  letter-spacing: 0.5rpx;
}

.card-desc {
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
  font-size: 26rpx;
  line-height: 1.5;
}

/* Divider */
.glass-divider {
  margin: var(--spacing-sm) 0;
  height: 1px;
  background: var(--border-default);
}

/* Fields */
.field {
  margin-top: var(--spacing-sm);
}

.field-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--text-secondary);
  font-size: 26rpx;
}

.field-help {
  margin-top: var(--spacing-xs);
  color: var(--text-muted);
  font-size: 24rpx;
}

/* Inputs */
.input,
.textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 80rpx;
  padding: 0 var(--spacing-sm);
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 32rpx;
  line-height: 80rpx;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--focus-ring);
}

.textarea {
  min-height: 200rpx;
  padding-top: var(--spacing-sm);
  line-height: 1.5;
}

.picker-value {
  min-width: 180rpx;
  text-align: right;
  color: var(--text-primary);
  font-size: 28rpx;
}

/* Buttons */
.btn-row {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.btn-row .btn {
  flex: 1;
  margin-top: 0;
}

.btn {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: 0;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 28rpx;
  font-weight: 400;
  letter-spacing: 2rpx;
  text-transform: uppercase;
  color: var(--bg-dark);
  background: var(--text-primary);
}

button.btn::after {
  border: none;
}

.btn:active {
  opacity: 0.9;
}

.btn[disabled] {
  opacity: 0.3;
}

/* Ghost Button */
.btn-ghost {
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-strong);
}

.btn-ghost:active {
  background: var(--bg-hover);
}

/* Accent Button */
.btn-accent {
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-strong);
}

.btn-accent:active {
  background: var(--bg-hover);
  border-color: var(--text-primary);
}

/* Rows */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.row + .row {
  margin-top: var(--spacing-sm);
}

.label {
  color: var(--text-secondary);
  font-size: 26rpx;
}

.value {
  color: var(--text-primary);
  font-size: 28rpx;
  font-weight: 400;
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-sm);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--spacing-sm);
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220rpx, 1fr));
  gap: var(--spacing-sm);
}

/* KPI Cards */
.kpi {
  padding: var(--spacing-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
}

.kpi:active {
  border-color: var(--border-strong);
}

.kpi-value {
  font-size: 40rpx;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.2;
}

.kpi-label {
  margin-top: var(--spacing-xs);
  font-size: 24rpx;
  color: var(--text-muted);
}

/* Module Cards */
.module-card {
  padding: var(--spacing-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
}

.module-card:active {
  border-color: var(--border-strong);
}

.module-name {
  color: var(--text-primary);
  font-size: 30rpx;
  font-weight: 400;
}

.module-desc {
  margin-top: var(--spacing-xs);
  color: var(--text-secondary);
  font-size: 24rpx;
  line-height: 1.5;
}

.module-tag {
  display: inline-block;
  margin-top: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  color: var(--text-muted);
  font-size: 22rpx;
  font-family: 'SF Mono', 'Consolas', monospace;
  text-transform: uppercase;
  letter-spacing: 1rpx;
  border: 1px solid var(--border-default);
}

/* List Items */
.list-item {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
}

.list-item:active {
  border-color: var(--border-strong);
}

.item-title {
  color: var(--text-primary);
  font-size: 28rpx;
  font-weight: 400;
  line-height: 1.4;
}

.item-sub {
  margin-top: var(--spacing-xs);
  color: var(--text-muted);
  font-size: 24rpx;
  line-height: 1.5;
}

/* Tags & Chips */
.tag {
  display: inline-block;
  margin-right: var(--spacing-xs);
  margin-bottom: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-strong);
  font-size: 24rpx;
  font-family: 'SF Mono', 'Consolas', monospace;
  text-transform: uppercase;
  letter-spacing: 1rpx;
  color: var(--text-primary);
  background: transparent;
}

.tag-danger {
  border-color: rgba(255, 91, 111, 0.5);
  color: rgba(255, 91, 111, 0.9);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}

.chip {
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--border-default);
  font-size: 24rpx;
  color: var(--text-secondary);
  background: transparent;
}

/* Progress Track - Minimalist */
.progress-track {
  margin-top: var(--spacing-xs);
  width: 100%;
  height: 4rpx;
  background: var(--border-default);
}

.progress-fill {
  height: 100%;
  background: rgba(255, 91, 111, 0.8);
}

.progress-fill-safe {
  height: 100%;
  background: var(--text-muted);
}

/* Status Labels */
.status-spam,
.status-ham,
.status-warn,
.status-pending {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 24rpx;
  font-family: 'SF Mono', 'Consolas', monospace;
  text-transform: uppercase;
  letter-spacing: 1rpx;
  border: 1px solid var(--border-strong);
}

.status-spam {
  color: rgba(255, 91, 111, 0.9);
  border-color: rgba(255, 91, 111, 0.5);
}

.status-ham {
  color: rgba(45, 207, 149, 0.9);
  border-color: rgba(45, 207, 149, 0.5);
}

.status-warn {
  color: rgba(255, 180, 84, 0.9);
  border-color: rgba(255, 180, 84, 0.5);
}

.status-pending {
  color: var(--text-muted);
  border-color: var(--border-default);
}

/* Pager */
.pager-row {
  margin-top: var(--spacing-sm);
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-sm);
}

.pager-btn {
  flex: 1;
}

/* Muted & Small */
.muted {
  color: var(--text-muted);
  font-size: 26rpx;
  line-height: 1.5;
}

.small {
  font-size: 24rpx;
}

.empty {
  text-align: center;
  padding: var(--spacing-lg);
  color: var(--text-muted);
  font-size: 26rpx;
  line-height: 1.5;
}

/* Animations */
.fade-up {
  animation: fadeUp 0.4s ease both;
}

.fade-up-delay-1 {
  animation-delay: 0.08s;
}

.fade-up-delay-2 {
  animation-delay: 0.16s;
}

.fade-up-delay-3 {
  animation-delay: 0.24s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16rpx);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Evidence Upload */
.evidence-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.evidence-item {
  position: relative;
  width: 120rpx;
  height: 120rpx;
  border: 1px solid var(--border-strong);
  overflow: hidden;
}

.evidence-thumb {
  width: 100%;
  height: 100%;
  display: block;
}

.evidence-clickable:active {
  opacity: 0.8;
}

.evidence-remove {
  position: absolute;
  top: -4rpx;
  right: -4rpx;
  width: 32rpx;
  height: 32rpx;
  background: rgba(255, 91, 111, 0.9);
  color: var(--text-primary);
  font-size: 24rpx;
  text-align: center;
  line-height: 32rpx;
}

.evidence-add {
  width: 120rpx;
  height: 120rpx;
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.evidence-add-icon {
  font-size: 48rpx;
  color: var(--text-muted);
}

/* Credit Score Bar */
.credit-score-bar {
  position: relative;
  width: 180rpx;
  height: 28rpx;
  background: var(--border-default);
}

.credit-fill {
  height: 100%;
  background: rgba(45, 207, 149, 0.6);
}

.credit-value {
  position: absolute;
  right: var(--spacing-xs);
  top: 50%;
  transform: translateY(-50%);
  font-size: 22rpx;
  color: var(--text-primary);
}

/* Report Modal */
.report-modal {
  margin-top: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  position: relative;
}

.report-header {
  text-align: center;
  margin-bottom: var(--spacing-sm);
}

.report-title {
  font-size: 36rpx;
  font-weight: 300;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Consolas', monospace;
}

.report-period {
  font-size: 24rpx;
  color: var(--text-muted);
  margin-top: var(--spacing-xs);
}

.report-close {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  width: 40rpx;
  height: 40rpx;
  color: rgba(255, 91, 111, 0.9);
  font-size: 32rpx;
  text-align: center;
  line-height: 40rpx;
}

.report-section {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: transparent;
  border-top: 1px solid var(--border-default);
}

.report-section-title {
  font-size: 28rpx;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
  font-family: 'SF Mono', 'Consolas', monospace;
  text-transform: uppercase;
  letter-spacing: 1rpx;
}

.report-kpi {
  padding: var(--spacing-sm);
  background: var(--bg-surface);
  text-align: center;
  border: 1px solid var(--border-default);
}

.report-kpi-value {
  font-size: 32rpx;
  font-weight: 300;
  color: var(--text-primary);
}

.report-kpi-label {
  font-size: 22rpx;
  color: var(--text-muted);
  margin-top: var(--spacing-xs);
}

.report-trend-item {
  margin-top: var(--spacing-xs);
}

/* Note textarea */
.note-textarea {
  min-height: 120rpx;
}

/* Media Query */
@media (max-width: 360px) {
  .hero-title {
    font-size: 40rpx;
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}