/**
 * 适老化方案参数化设计推演助手 - 授权系统样式
 * 设计风格：简洁、专业、适老化友好
 */

/* ============ 基础重置 ============ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #333;
  font-size: 16px;
  line-height: 1.6;
}

/* ============ 容器 ============ */

.container {
  width: 100%;
  max-width: 480px;
}

.container.wide {
  max-width: 1200px;
  align-items: flex-start;
  padding-top: 20px;
}

/* ============ 卡片 ============ */

.card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.logo {
  font-size: 48px;
  margin-bottom: 16px;
}

h1 {
  font-size: 24px;
  color: #1a1a2e;
  margin-bottom: 8px;
  font-weight: 700;
}

.subtitle {
  color: #666;
  font-size: 14px;
  margin-bottom: 32px;
}

/* ============ 表单 ============ */

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #444;
  margin-bottom: 8px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.2s;
  outline: none;
  background: #fafafa;
}

.form-group input:focus,
.form-group select:focus {
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
  color: #aaa;
}

/* ============ 按钮 ============ */

.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 10px 20px;
  background: #f0f0f0;
  color: #555;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin: 2px;
  transition: all 0.2s;
}

.btn-sm:hover {
  opacity: 0.85;
}

.btn-danger {
  background: #ff4757;
  color: #fff;
}

.btn-success {
  background: #2ed573;
  color: #fff;
}

.btn-warning {
  background: #ffa502;
  color: #fff;
}

.btn-info {
  background: #3742fa;
  color: #fff;
}

/* ============ 消息提示 ============ */

.message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.message.error {
  background: #fff0f0;
  color: #ff4757;
  border: 1px solid #ffd0d0;
}

.message.success {
  background: #f0fff4;
  color: #2ed573;
  border: 1px solid #c0f0d0;
}

/* ============ 成功面板 ============ */

.success-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

#successPanel h2 {
  color: #2ed573;
  margin-bottom: 12px;
}

#successPanel p {
  color: #666;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.8;
}

/* ============ 隐藏 ============ */

.hidden {
  display: none !important;
}

/* ============ 页脚 ============ */

.footer {
  text-align: center;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

/* ============ 管理后台专用 ============ */

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
}

.header-bar h1 {
  font-size: 22px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 13px;
  color: #888;
}

/* 操作栏 */
.action-bar {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.form-inline label {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.form-inline input {
  padding: 8px 12px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.form-inline input:focus {
  border-color: #667eea;
}

.form-inline .btn-primary {
  width: auto;
  padding: 10px 20px;
  margin: 0;
  font-size: 14px;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.filter-bar input,
.filter-bar select {
  padding: 10px 14px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: #667eea;
}

/* 表格 */
.table-container {
  background: #fff;
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #f8f9fa;
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #e8e8e8;
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  vertical-align: middle;
}

tbody tr:hover {
  background: #f8f9ff;
}

tbody tr:last-child td {
  border-bottom: none;
}

code {
  background: #f0f0f0;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'SF Mono', 'Monaco', monospace;
  color: #333;
}

.action-cell {
  white-space: nowrap;
}

/* 状态标签 */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-unused {
  background: #e8f5e9;
  color: #2e7d32;
}

.status-used {
  background: #e3f2fd;
  color: #1565c0;
}

.status-disabled {
  background: #fce4ec;
  color: #c62828;
}

.status-expired {
  background: #fff3e0;
  color: #e65100;
}

.status-bound_to_other {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 16px 0;
}

.page-btn {
  padding: 8px 14px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.page-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.page-btn.active {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

/* 区块 */
.section {
  margin-top: 32px;
}

.section h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #333;
}

/* ============ 响应式 ============ */

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar {
    flex-direction: column;
  }

  .card {
    padding: 24px;
  }

  h1 {
    font-size: 20px;
  }

  .header-bar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .card {
    padding: 20px;
    border-radius: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-number {
    font-size: 24px;
  }

  table {
    font-size: 12px;
  }

  thead th, tbody td {
    padding: 8px 10px;
  }
}
