/* ========== 基础变量 ========== */
:root {
  /* 品牌色 —— 深蓝法律科技风 */
  --navy-900: #0f1d36;
  --navy-800: #162744;
  --navy-700: #1e3456;
  --navy-600: #2a4670;
  --navy-500: #3d5c8a;
  --navy-400: #6b85ad;
  --navy-200: #b8c5dc;
  --navy-100: #e4eaf4;

  /* 中性色 */
  --gray-900: #1a1d23;
  --gray-700: #3a3f4a;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f8f9fb;
  --white: #ffffff;

  /* 风险等级 */
  --risk-high: #d9403a;
  --risk-high-bg: #fdeceb;
  --risk-high-border: #f5b9b6;
  --risk-medium: #d9901c;
  --risk-medium-bg: #fef5e3;
  --risk-medium-border: #f4d59b;
  --risk-low: #2f8a5a;
  --risk-low-bg: #e7f3ed;
  --risk-low-border: #a8d4bb;
  --risk-info: var(--navy-500);
  --risk-info-bg: var(--navy-100);
  --risk-info-border: var(--navy-200);

  /* 字体 */
  --font-display: 'Playfair Display', Georgia, 'Noto Serif SC', serif;
  --font-body: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* 其他 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-soft: 0 1px 3px rgba(15, 29, 54, 0.04), 0 4px 12px rgba(15, 29, 54, 0.06);
  --shadow-card: 0 2px 6px rgba(15, 29, 54, 0.06), 0 12px 32px rgba(15, 29, 54, 0.08);
}

/* ========== 重置 ========== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  color: var(--gray-700);
  background: var(--gray-50);
  min-height: 100vh;
  line-height: 1.6;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

select,
input {
  font-family: inherit;
}

/* ========== 头部 ========== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(1.2);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  background: var(--navy-800);
  color: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: 0.01em;
}

.brand-subtitle {
  font-size: 0.7rem;
  color: var(--gray-400);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--risk-low);
  box-shadow: 0 0 0 3px var(--risk-low-bg);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ========== 主区域 ========== */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
  animation: fadeUp 0.4s ease-out;
}

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

.panel-header {
  padding: 28px 32px 0;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: 0.01em;
}

.panel-desc {
  font-size: 0.88rem;
  color: var(--gray-500);
  margin-top: 6px;
}

.panel-body {
  padding: 28px 32px 32px;
}

/* ========== 表单 ========== */
.form-group {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--navy-700);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* 文件上传 */
.file-dropzone {
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: all 0.2s ease;
  cursor: pointer;
  background: var(--gray-50);
}

.file-dropzone:hover,
.file-dropzone.dragover {
  border-color: var(--navy-500);
  background: var(--navy-100);
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  color: var(--navy-500);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-icon svg {
  width: 36px;
  height: 36px;
}

.dropzone-text {
  font-size: 0.95rem;
  color: var(--gray-700);
}

.dropzone-hint {
  color: var(--navy-600);
  font-weight: 500;
  margin-right: 4px;
}

.dropzone-sub {
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* 文件已选中 */
.file-info {
  margin-top: 12px;
}

.file-info-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--navy-100);
  border: 1px solid var(--navy-200);
  border-radius: var(--radius-md);
}

.file-icon {
  width: 40px;
  height: 40px;
  background: var(--navy-800);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--navy-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 0.76rem;
  color: var(--gray-500);
}

.file-remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--gray-500);
  transition: all 0.15s;
  flex-shrink: 0;
}

.file-remove:hover {
  background: var(--risk-high-bg);
  color: var(--risk-high);
}

.file-remove svg {
  width: 16px;
  height: 16px;
}

/* 下拉选择 */
.form-select {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.92rem;
  color: var(--gray-700);
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: border-color 0.15s;
}

.form-select:hover {
  border-color: var(--gray-300);
}

.form-select:focus {
  outline: none;
  border-color: var(--navy-500);
  box-shadow: 0 0 0 3px var(--navy-100);
}

/* 立场选项 */
.stance-options {
  display: flex;
  gap: 8px;
}

.stance-option {
  flex: 1;
  position: relative;
}

.stance-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stance-option span {
  display: block;
  text-align: center;
  padding: 11px 10px;
  font-size: 0.85rem;
  color: var(--gray-700);
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.stance-option:hover span {
  border-color: var(--gray-300);
}

.stance-option input:checked + span {
  border-color: var(--navy-600);
  background: var(--navy-100);
  color: var(--navy-800);
  font-weight: 500;
}

/* 提交按钮 */
.submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--navy-800);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(15, 29, 54, 0.2);
}

.btn-submit:hover:not(:disabled) {
  background: var(--navy-900);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 29, 54, 0.25);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

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

.btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.btn-submit:hover:not(:disabled) .btn-arrow {
  transform: translateX(3px);
}

/* ========== 状态面板 ========== */
.status-panel {
  padding: 40px 32px;
}

.status-card {
  text-align: center;
}

.status-spinner {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 2.5px solid var(--gray-200);
  border-top-color: var(--navy-600);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-core {
  position: absolute;
  inset: 16px;
  background: var(--navy-100);
  border-radius: 50%;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-text {
  margin-bottom: 28px;
}

.status-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy-900);
}

.status-desc {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 6px;
}

.status-steps {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--gray-400);
  transition: color 0.3s;
}

.step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
  transition: all 0.3s;
}

.step.active {
  color: var(--navy-700);
}

.step.active .step-dot {
  background: var(--navy-600);
  box-shadow: 0 0 0 3px var(--navy-100);
  animation: pulse 1.6s infinite;
}

.step.done {
  color: var(--risk-low);
}

.step.done .step-dot {
  background: var(--risk-low);
  box-shadow: 0 0 0 3px var(--risk-low-bg);
}

/* ========== 结果面板 ========== */
.result-panel {
  padding-bottom: 32px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-100);
}

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

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--navy-600);
  background: var(--navy-100);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.btn-ghost:hover {
  background: var(--navy-200);
}

.btn-ghost svg {
  width: 14px;
  height: 14px;
}

/* 总览 */
.result-summary {
  padding: 24px 32px 0;
}

.summary-card {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-600) 100%);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.summary-score {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}

.summary-score-label {
  font-size: 0.78rem;
  opacity: 0.75;
  letter-spacing: 0.05em;
}

.summary-title-wrap {
  margin-bottom: 8px;
}

.summary-title {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 3px 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.summary-right {
  display: flex;
  gap: 20px;
}

.summary-stat {
  text-align: center;
}

.stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
}

.stat-label {
  font-size: 0.7rem;
  opacity: 0.7;
  letter-spacing: 0.05em;
}

/* 审查意见列表 */
.result-body {
  padding: 28px 32px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.review-item:hover {
  box-shadow: 0 2px 8px rgba(15, 29, 54, 0.06);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 4px;
  flex-shrink: 0;
}

.risk-badge.high {
  background: var(--risk-high-bg);
  color: var(--risk-high);
  border: 1px solid var(--risk-high-border);
}

.risk-badge.medium {
  background: var(--risk-medium-bg);
  color: var(--risk-medium);
  border: 1px solid var(--risk-medium-border);
}

.risk-badge.low {
  background: var(--risk-low-bg);
  color: var(--risk-low);
  border: 1px solid var(--risk-low-border);
}

.risk-badge.info {
  background: var(--risk-info-bg);
  color: var(--risk-info);
  border: 1px solid var(--risk-info-border);
}

.risk-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.review-title {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--navy-900);
}

.review-chevron {
  width: 16px;
  height: 16px;
  color: var(--gray-400);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.review-item.open .review-chevron {
  transform: rotate(180deg);
}

.review-content {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--gray-100);
  animation: slideDown 0.25s ease-out;
}

.review-item.open .review-content {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 600px;
  }
}

.review-section {
  padding-top: 16px;
}

.review-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.review-section p {
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.7;
}

.review-section.suggestion {
  background: var(--navy-100);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 12px;
}

.review-section.suggestion p {
  color: var(--navy-800);
}

/* ========== 错误面板 ========== */
.error-panel {
  padding: 36px 32px;
}

.error-card {
  text-align: center;
}

.error-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--risk-high);
}

.error-icon svg {
  width: 100%;
  height: 100%;
}

.error-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy-900);
  margin-bottom: 6px;
}

.error-msg {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* ========== 底部 ========== */
.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 40px;
  text-align: center;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--gray-400);
  line-height: 1.6;
}

/* ========== 响应式 ========== */
@media (max-width: 640px) {
  .header-inner {
    padding: 14px 16px;
  }

  .main {
    padding: 24px 16px 40px;
  }

  .panel-header,
  .panel-body,
  .result-summary,
  .result-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .stance-options {
    flex-direction: column;
  }

  .status-steps {
    gap: 16px;
    flex-wrap: wrap;
  }

  .summary-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .summary-right {
    gap: 28px;
  }

  .submit-row {
    justify-content: stretch;
  }

  .btn-submit {
    width: 100%;
    justify-content: center;
  }

  .header-meta {
    display: none;
  }
}
