/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --bg-color: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 布局 & 卡片 */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }
.card {
  background-color: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

/* 标题区 */
h1 { font-size: 1.875rem; font-weight: 700; text-align: center; margin-bottom: 32px; color: var(--text-main); letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 24px; color: var(--text-main); display: flex; align-items: center; }
h2::before { content: ''; display: inline-block; width: 4px; height: 18px; background: var(--primary); border-radius: 4px; margin-right: 10px; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.header h2 { margin-bottom: 0; border: none; padding: 0; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: var(--transition);
}
.btn-primary { background-color: rgba(99, 102, 241, 0.1); color: var(--primary); }
.btn-primary:hover { background-color: var(--primary); color: white; transform: translateY(-1px); }
.btn-success { background-color: var(--primary); color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25); }
.btn-success:hover { background-color: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3); }
.btn-danger { background-color: rgba(239, 68, 68, 0.1); color: var(--danger); }
.btn-danger:hover { background-color: var(--danger); color: white; transform: translateY(-1px); }
.btn-block { width: 100%; padding: 14px; font-size: 1rem; border-radius: var(--radius-md); }

/* 表单输入框 */
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); }
input, select, textarea {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 1rem;
  background-color: var(--bg-color); transition: var(--transition); color: var(--text-main);
}
input:focus { outline: none; border-color: var(--primary); background-color: var(--surface); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

/* 表格 (现代化去边框设计) */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; }
th { background-color: var(--bg-color); color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 16px; font-weight: 600; white-space: nowrap; }
td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 0.875rem; color: var(--text-main); }
tr:last-child td { border-bottom: none; }
tr:hover td { background-color: rgba(248, 250, 252, 0.8); }

/* 辅助与状态文字 */
.back-link { display: inline-flex; align-items: center; color: var(--text-muted); text-decoration: none; font-size: 0.875rem; margin-bottom: 24px; transition: var(--transition); }
.back-link:hover { color: var(--primary); }
.error-message { color: var(--danger); margin-top: 12px; font-size: 0.875rem; background: rgba(239, 68, 68, 0.05); padding: 10px; border-radius: var(--radius-sm); }
.success-message { color: var(--success); margin-top: 12px; font-size: 0.875rem; background: rgba(16, 185, 129, 0.05); padding: 10px; border-radius: var(--radius-sm); }

/* 特殊视图模块 */
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.info-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--border); font-size: 0.95rem; }
.info-item:last-child { border-bottom: none; }
.info-item strong { color: var(--text-muted); font-weight: 500; }
.info-item span { font-weight: 600; }

/* 电子票面特殊 UI */
.ticket-card { position: relative; background: linear-gradient(135deg, var(--primary), #818cf8); color: white; border-radius: var(--radius-lg); padding: 40px 20px; text-align: center; box-shadow: var(--shadow-lg); overflow: hidden; margin-top: 20px; }
.ticket-card::before, .ticket-card::after { content: ''; position: absolute; top: 50%; width: 30px; height: 30px; background-color: var(--bg-color); border-radius: 50%; transform: translateY(-50%); }
.ticket-card::before { left: -15px; } .ticket-card::after { right: -15px; }
.qr-wrapper { background: white; padding: 20px; border-radius: var(--radius-md); display: inline-block; margin: 24px 0; box-shadow: var(--shadow-sm); }
.qr-wrapper img { width: 220px; height: 220px; display: block; }
.ticket-id-display { font-family: monospace; font-size: 1.25rem; letter-spacing: 2px; margin-top: 10px; background: rgba(255,255,255,0.2); padding: 8px 16px; border-radius: 20px; display: inline-block; }

/* 登录框居中特化 */
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius-lg); padding: 48px 32px; box-shadow: var(--shadow-lg); }

/* 检票切换按钮 */
.check-methods { display: flex; gap: 12px; margin-bottom: 32px; background: var(--bg-color); padding: 6px; border-radius: var(--radius-sm); }
.method-btn { flex: 1; padding: 12px; border-radius: var(--radius-sm); cursor: pointer; text-align: center; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); transition: var(--transition); }
.method-btn.active { background-color: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* 二维码生成区特化 */
.qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; text-align: center; margin-top: 24px; }
.qr-grid img { max-width: 180px; border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 10px; margin-bottom: 12px; }

/* 移动端深度适配 */
@media (max-width: 768px) {
  .container { padding: 16px 12px; }
  .card { padding: 20px; border-radius: var(--radius-md); }
  h1 { font-size: 1.5rem; margin-bottom: 24px; }
  .header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .header .btn { width: 100%; }
  .action-buttons { flex-direction: column; width: 100%; }
  .action-buttons .btn { width: 100%; justify-content: center; }
  
  /* 移动端卡片式表格黑科技 */
  table, thead, tbody, th, td, tr { display: block; width: 100%; }
  thead tr { position: absolute; top: -9999px; left: -9999px; }
  tr { margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
  td { position: relative; padding: 12px 16px 12px 40%; text-align: right; border-bottom: 1px dashed var(--border); display: flex; justify-content: flex-end; align-items: center; min-height: 48px; }
  td::before { content: attr(data-label); position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 35%; text-align: left; font-weight: 500; color: var(--text-muted); font-size: 0.85rem; }
  td:last-child { border-bottom: none; }
  .qr-grid { grid-template-columns: 1fr; }
}

/* 检票结果提示弹窗 */
.result { display: none; margin-top: 24px; padding: 20px; border-radius: var(--radius-md); animation: slideUp 0.3s ease-out; }
.result h3 { margin-bottom: 12px; font-size: 1.125rem; }
.result.success { background-color: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--success-hover); }
.result.error { background-color: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--danger-hover); }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }