* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f0f2f5;
  color: #333;
  line-height: 1.6;
}

/* Auth pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 50%, #4a90d9 100%);
}
.auth-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 36px;
  width: 400px;
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
}
.auth-logo {
  font-size: 24px;
  text-align: center;
  color: #1F4E79;
  margin-bottom: 4px;
}
.auth-sub {
  text-align: center;
  color: #888;
  font-size: 14px;
  margin-bottom: 28px;
}
.auth-form label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
  margin-top: 14px;
}
.auth-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color .2s;
}
.auth-form input:focus { outline: none; border-color: #1F4E79; }
.auth-error { color: #e74c3c; font-size: 13px; margin-top: 8px; min-height: 20px; }
.auth-switch { text-align: center; font-size: 13px; margin-top: 18px; color: #999; }
.auth-switch a { color: #1F4E79; text-decoration: none; font-weight: 600; }

/* Admin entry */
.admin-entry { text-align: center; margin-top: 8px; }
.admin-entry a { font-size: 12px; color: #bbb; text-decoration: none; transition: color .2s; }
.admin-entry a:hover { color: #1F4E79; }

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 11px;
  margin-top: 16px;
  background: #1F4E79;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-primary:hover { background: #163d5e; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-outline {
  padding: 8px 18px;
  border: 1px solid #1F4E79;
  color: #1F4E79;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.btn-outline:hover { background: #1F4E79; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-text { background: none; border: none; color: #999; cursor: pointer; font-size: 13px; }
.btn-text:hover { color: #e74c3c; }

/* Topbar */
.topbar {
  background: #1F4E79;
  color: #fff;
  padding: 0 24px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.topbar-brand { font-size: 16px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { font-size: 14px; }
.topbar-plans { display: flex; align-items: center; gap: 8px; }
.plan-badge {
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.plan-badge.free { background: #e8e8e8; color: #666; }
.plan-badge.basic { background: #ffe7ba; color: #ad6800; }
.plan-badge.pro { background: #d6e4ff; color: #1d39c4; }
.quota-text { font-size: 13px; color: rgba(255,255,255,.8); }
.quota-text strong { color: #fff; }

/* Guide bar */
.guide-bar {
  background: #f4f8fc;
  border-bottom: 1px solid #dce8f2;
  padding: 10px 16px;
}
.guide-steps-h {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.guide-step-h {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #555;
  white-space: nowrap;
}
.guide-arrow { color: #ccc; font-size: 14px; flex-shrink: 0; }
.guide-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1F4E79;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.guide-hl { color: #1F4E79; font-weight: 600; }
@media (max-width: 1000px) {
  .guide-arrow { display: none; }
  .guide-steps-h { gap: 8px 14px; }
}

/* Main layout */
.main-analyze {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px;
}
.analyze-layout {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 20px;
  align-items: start;
}

/* Panels */
.panel { background: #fff; border-radius: 8px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.panel h2 { font-size: 17px; color: #1F4E79; margin-bottom: 16px; }
.panel h3 { font-size: 15px; color: #1F4E79; margin-bottom: 12px; }

/* Config form */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; }
.form-group input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 5px;
  font-size: 14px;
}
.form-group input:focus { outline: none; border-color: #1F4E79; }
.config-note { font-size: 12px; color: #999; margin: 10px 0; line-height: 1.7; }
.btn-analyze { width: 100%; margin-top: 8px; }

/* Province selector */
select#homeProvince {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 5px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999'><path d='M6 8L1 3h10z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
select#homeProvince:focus { outline: none; border-color: #1F4E79; }

/* Subject selector */
.cb-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  padding: 5px 8px;
  margin: 2px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s;
}
.cb-sub:hover { background: #f0f4f8; }
.cb-sub input[type=radio],
.cb-sub input[type=checkbox] {
  accent-color: #1F4E79;
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.subject-hint { font-size: 11px; color: #999; margin-bottom: 6px; }
.subject-checks { display: flex; flex-wrap: wrap; gap: 3px; }
.subject-section { margin-bottom: 10px; }
.subject-section .cb-sub { display: flex; align-items: center; }

/* Province checkboxes */
.province-groups { margin-top: 6px; }
.province-group { margin-bottom: 6px; }
.pg-title { font-size: 12px; color: #1F4E79; font-weight: 600; cursor: pointer; padding: 4px 0; user-select: none; }
.pg-title:hover { color: #2d6a9f; }
.pg-items { display: flex; flex-wrap: wrap; gap: 2px 4px; margin-top: 4px; }
.pg-items.collapsed { display: none; }

/* Checkbox labels */
.cb-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  transition: background .15s;
}
.cb-label:hover { background: #f0f4f8; }
.cb-label input[type=checkbox] { accent-color: #1F4E79; width: 14px; height: 14px; cursor: pointer; }
.cb-major { font-size: 13px; padding: 5px 8px; display: block; }

/* Major checkboxes */
.cb-all {
  font-size: 14px;
  font-weight: 600;
  color: #1F4E79;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;
  padding-bottom: 6px;
}
.major-sub { padding-left: 8px; }
.mj-hint { font-size: 11px; color: #bbb; margin-left: 4px; font-weight: normal; }
.cb-major:hover .mj-hint { color: #888; }
.major-checkboxes { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }

/* Toggle links */
.flex-row { display: flex; justify-content: space-between; align-items: center; }
.toggle-links { font-size: 12px; }
.toggle-links a { color: #1F4E79; text-decoration: none; cursor: pointer; }
.toggle-links a:hover { text-decoration: underline; }
.toggle-sep { color: #ddd; margin: 0 4px; }

/* Upgrade section */
.upgrade-section { margin-top: 32px; padding-top: 20px; border-top: 1px solid #f0f0f0; }
.plan-cards { display: flex; gap: 10px; }
.plan-card {
  flex: 1;
  text-align: center;
  padding: 14px 10px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  transition: all .2s;
}
.plan-card.active { border-color: #1F4E79; background: #f4f8fc; }
.plan-name { font-size: 13px; color: #666; font-weight: 600; }
.plan-price { font-size: 22px; font-weight: 700; color: #333; margin: 4px 0; }
.plan-price .yen { font-size: 14px; font-weight: 500; }
.plan-quota { font-size: 12px; color: #999; margin-bottom: 8px; }
.plan-current { font-size: 12px; color: #1F4E79; font-weight: 600; }

/* Activation code */
.activate-row { display: flex; gap: 8px; margin-top: 4px; }
.activate-row input { flex: 1; padding: 7px 10px; border: 1px solid #d9d9d9; border-radius: 5px; font-size: 13px; font-family: monospace; letter-spacing: 1px; }
.activate-row input:focus { outline: none; border-color: #1F4E79; }
.activate-msg { font-size: 12px; margin-top: 4px; min-height: 18px; }

/* Results */
.panel-results { min-height: 500px; }
.results-empty { text-align: center; padding: 60px 20px; color: #bbb; }
.empty-icon { font-size: 48px; margin-bottom: 10px; }
.empty-hint { font-size: 13px; color: #ccc; margin-top: 6px; }
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #999;
  font-size: 14px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e8e8e8;
  border-top-color: #1F4E79;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.summary-bar { padding: 10px 14px; background: #f4f8fc; border-radius: 6px; font-size: 14px; color: #1F4E79; margin-bottom: 14px; }
.rec-link { color: #e67e22; cursor: pointer; font-weight: 600; text-decoration: underline; }
.rec-link:hover { color: #d35400; }
.tabs { display: flex; gap: 0; margin-bottom: 14px; border-bottom: 2px solid #f0f0f0; }
.tab {
  padding: 8px 20px;
  background: none;
  border: none;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}
.tab:hover { color: #1F4E79; }
.tab.active { color: #1F4E79; border-bottom-color: #1F4E79; font-weight: 600; }
.tab-count { font-size: 12px; color: #bbb; margin-left: 4px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { background: #1F4E79; color: #fff; padding: 8px 10px; text-align: left; font-weight: 500; white-space: nowrap; }
.data-table td { padding: 7px 10px; border-bottom: 1px solid #f5f5f5; white-space: nowrap; }
.data-table tr:hover td { background: #fafafa; }

/* Responsive */
@media (max-width: 768px) {
  .analyze-layout { grid-template-columns: 1fr; }
  .auth-card { width: 90%; padding: 28px 24px; }
  .plan-cards { flex-direction: column; }
}


/* History table */
#historySection .mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
#historySection .mini-table th { background: #f8f9fa; padding: 6px 8px; text-align: left; font-weight: 600; color: #555; border-bottom: 1px solid #eee; }
#historySection .mini-table td { padding: 5px 8px; border-bottom: 1px solid #f5f5f5; }
#historySection .mini-table tr:hover td { background: #fafafa; }

.tips-section { margin-bottom: 16px; }
.tips-header { cursor: pointer; user-select: none; }
.tips-header h3 { font-size: 14px; color: #e67e22; margin-bottom: 8px; }
.tips-body { transition: all .3s; }
.tips-body.collapsed { display: none; }
.tip-item { display: flex; gap: 8px; font-size: 12px; color: #555; padding: 5px 0; border-bottom: 1px solid #f9f9f9; line-height: 1.6; }
.tip-num { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: #e67e22; color: #fff; font-size: 10px; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.tip-item b { color: #e67e22; }

.pay-popup { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.5); z-index:9999; display:flex; align-items:center; justify-content:center; }
.pay-popup-content { background:#fff; border-radius:12px; padding:24px; width:340px; position:relative; box-shadow:0 8px 30px rgba(0,0,0,.2); }
.pay-close { position:absolute; top:8px; right:12px; font-size:24px; cursor:pointer; color:#bbb; }
.pay-close:hover { color:#333; }
.btn-pay { background:#e67e22 !important; color:#fff !important; border:none !important; }
.btn-pay:hover { background:#d35400 !important; color:#fff !important; }

/* ICP备案 页脚 */
.beian-footer {
  text-align: center;
  padding: 16px 0 20px;
  font-size: 12px;
}
.beian-footer a {
  color: #999;
  text-decoration: none;
}
.beian-footer a:hover {
  color: #666;
  text-decoration: underline;
}
