/* ============================================================
   ROHSLINK - 全局样式
   ============================================================ */

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

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
  background: #f4f5f9;
  color: #333;
  min-height: 100vh;
}

/* ---- 顶部导航 ---- */
.header {
  background: linear-gradient(135deg, #2e7d32 0%, #4caf50 100%);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(90,73,152,.35);
}
.logo {
  font-size: 22px;
  color: #fff;
  font-weight: 700;
  letter-spacing: 2px;
  text-decoration: none;
}
.top-nav { display:flex; align-items:center; gap:24px; }
.top-nav a { color:#c8e6c9; text-decoration:none; font-size:14px; transition:color .2s; }
.top-nav a:hover { color:#fff; }
.nav-user { color:#ffd; font-size:14px; }
.nav-logout {
  background: rgba(255,255,255,.18);
  padding: 5px 14px;
  border-radius: 20px;
  color: #fff !important;
  font-size: 13px;
}
.nav-logout:hover { background:rgba(255,255,255,.3); }

/* ---- 布局 ---- */
.wrap {
  display: flex;
  width: 1200px;
  max-width: 96vw;
  margin: 30px auto;
  gap: 24px;
  align-items: flex-start;
}

/* ---- 侧栏 ---- */
.sidebar {
  width: 210px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(90,73,152,.10);
  overflow: hidden;
}
.sidebar-item {
  display: block;
  padding: 14px 20px;
  font-size: 14px;
  color: #555;
  text-decoration: none;
  border-left: 4px solid transparent;
  transition: all .18s;
}
.sidebar-item:hover { background: #f1f8e9; color: #2e7d32; }
.sidebar-item.active {
  background: #e8f5e9;
  border-left-color: #2e7d32;
  color: #2e7d32;
  font-weight: 600;
}

/* ---- 主内容区 ---- */
.main {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 30px 32px;
  box-shadow: 0 2px 12px rgba(90,73,152,.10);
  min-height: 500px;
}
.main-title {
  font-size: 20px;
  color: #333;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid #e8f5e9;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- 信息卡片 ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.card {
  background: linear-gradient(135deg, #e8f5e9 0%, #e8e0ff 100%);
  border-radius: 10px;
  padding: 18px 20px;
  border: 1px solid #c8e6c9;
}
.card-label { font-size: 12px; color: #558b2f; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.card-value { font-size: 22px; font-weight: 700; color: #2e7d32; }
.card-sub   { font-size: 12px; color: #999; margin-top: 4px; }

.card.green  { background: linear-gradient(135deg,#efffef,#d6f5dc); border-color:#b2ddb6; }
.card.green .card-label { color: #4a9a55; }
.card.green .card-value { color: #2e7d32; }

.card.red    { background: linear-gradient(135deg,#fff4f4,#ffd9d9); border-color:#f5b8b8; }
.card.red .card-label { color: #b94; }
.card.red .card-value { color: #c62828; }

.card.blue   { background: linear-gradient(135deg,#eaf4ff,#d4eaff); border-color:#90caf9; }
.card.blue .card-label { color: #1976d2; }
.card.blue .card-value { color: #0d47a1; }

/* ---- 信息框 ---- */
.info-box {
  background: #f9fbe7;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.info-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e8f5e9;
  gap: 12px;
}
.info-row:last-child { border-bottom: none; }
.info-label { width: 130px; font-size: 13px; color: #888; flex-shrink: 0; }
.info-val   { font-size: 14px; color: #333; word-break: break-all; }
.info-val code {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-family: monospace;
  user-select: all;
  cursor: text;
}
.copy-btn {
  background: #2e7d32;
  color: #fff;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 6px;
  transition: background .2s;
}
.copy-btn:hover { background: #4caf50; }

/* ---- 流量进度条 ---- */
.progress-wrap { margin: 6px 0; }
.progress-bar {
  height: 10px;
  background: #c8e6c9;
  border-radius: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2e7d32, #81c784);
  border-radius: 8px;
  transition: width .5s;
}
.progress-fill.danger { background: linear-gradient(90deg,#e53935,#ef9a9a); }
.progress-text { font-size: 12px; color: #999; margin-top: 4px; }

/* ---- 表单 ---- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; font-weight: 500; }
.form-control {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border .2s;
}
.form-control:focus { border-color: #2e7d32; box-shadow: 0 0 0 3px rgba(90,73,152,.12); }
.form-hint { font-size: 12px; color: #aaa; margin-top: 4px; }

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  font-weight: 500;
}
.btn-primary { background: #2e7d32; color: #fff; }
.btn-primary:hover { background: #4caf50; transform: translateY(-1px); }
.btn-success { background: #2e7d32; color: #fff; }
.btn-success:hover { background: #388e3c; }
.btn-danger  { background: #c62828; color: #fff; }
.btn-danger:hover  { background: #e53935; }
.btn-outline { background: #fff; color: #2e7d32; border: 2px solid #2e7d32; }
.btn-outline:hover { background: #e8f5e9; }
.btn-sm { padding: 5px 14px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { border: 1px solid #eee; padding: 11px 14px; font-size: 13px; text-align: center; }
th { background: #f1f8e9; color: #2e7d32; font-weight: 600; }
tr:hover td { background: #fafaff; }
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff8e1; color: #f57f17; }
.badge-danger  { background: #ffebee; color: #c62828; }
.badge-info    { background: #e3f2fd; color: #1565c0; }
.badge-default { background: #f5f5f5; color: #757575; }

/* ---- 套餐卡片 ---- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin: 20px 0;
}
.plan-card {
  border: 2px solid #a5d6a7;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  transition: all .2s;
  cursor: pointer;
}
.plan-card:hover, .plan-card.selected {
  border-color: #2e7d32;
  box-shadow: 0 4px 20px rgba(90,73,152,.18);
  transform: translateY(-2px);
}
.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg,#ff6b6b,#ff8e53);
  color: #fff;
  font-size: 11px;
  padding: 3px 14px;
  border-radius: 20px;
  font-weight: 600;
}
.plan-name  { font-size: 16px; font-weight: 700; color: #333; margin-bottom: 8px; }
.plan-price { font-size: 36px; font-weight: 800; color: #2e7d32; line-height: 1.1; }
.plan-price span { font-size: 16px; color: #999; font-weight: 400; }
.plan-features { margin: 14px 0; font-size: 13px; color: #666; line-height: 2; }

/* ---- 支付方式 ---- */
.pay-methods { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.pay-method {
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all .18s;
  font-weight: 500;
}
.pay-method:hover, .pay-method.selected {
  border-color: #2e7d32;
  background: #e8f5e9;
  color: #2e7d32;
}
.pay-method img { height: 22px; }

/* ---- 工单 ---- */
.ticket-list { margin-top: 10px; }
.ticket-item {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: box-shadow .2s;
}
.ticket-item:hover { box-shadow: 0 2px 10px rgba(90,73,152,.12); }
.ticket-subject { font-size: 15px; color: #333; font-weight: 500; }
.ticket-meta    { font-size: 12px; color: #aaa; margin-top: 4px; }
.ticket-chat {
  background: #f9fbe7;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  max-height: 400px;
  overflow-y: auto;
}
.msg { margin-bottom: 14px; }
.msg-from-user .msg-bubble {
  background: #2e7d32;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}
.msg-from-admin .msg-bubble {
  background: #e8f5e9;
  color: #333;
  border-radius: 16px 16px 16px 4px;
}
.msg-bubble { display: inline-block; padding: 10px 16px; max-width: 75%; font-size: 14px; line-height: 1.6; }
.msg-meta { font-size: 11px; color: #bbb; margin-top: 4px; }
.msg-from-user { text-align: right; }

/* ---- 提示 ---- */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #b2dfdb; }
.alert-danger  { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.alert-warning { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }

/* ---- 教程文章 ---- */
.article-list { margin-top: 10px; }
.article-item {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all .18s;
}
.article-item:hover { border-color: #2e7d32; background: #f9fbe7; }
.article-title { font-size: 15px; font-weight: 600; color: #2e7d32; }
.article-preview { font-size: 13px; color: #888; margin-top: 6px; }
.article-body { margin-top: 20px; line-height: 1.85; font-size: 14px; color: #444; }
.article-body h3 { color: #2e7d32; margin: 16px 0 8px; font-size: 16px; }
.article-body p  { margin-bottom: 10px; }
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #2e7d32, #4caf50);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  text-decoration: none;
  margin-top: 10px;
  font-weight: 500;
  transition: opacity .2s;
}
.download-btn:hover { opacity: .9; }

/* ---- 登录/注册页 ---- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2e7d32 0%, #81c784 50%, #C8B8F8 100%);
}
.auth-box {
  background: #fff;
  border-radius: 18px;
  padding: 40px 44px;
  width: 420px;
  max-width: 94vw;
  box-shadow: 0 8px 40px rgba(90,73,152,.25);
}
.auth-logo { text-align: center; font-size: 30px; margin-bottom: 8px; }
.auth-title { text-align: center; font-size: 20px; font-weight: 700; color: #2e7d32; margin-bottom: 28px; }
.auth-footer { text-align: center; font-size: 13px; color: #aaa; margin-top: 20px; }
.auth-footer a { color: #2e7d32; text-decoration: none; }

/* ---- 页脚 ---- */
.footer {
  text-align: center;
  font-size: 13px;
  color: #bbb;
  padding: 24px 0 32px;
}
.footer a { color: #aaa; text-decoration: none; }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .wrap { flex-direction: column; }
  .sidebar { width: 100%; display: flex; flex-wrap: wrap; }
  .sidebar-item { flex: 1; text-align: center; border-left: none; border-bottom: 3px solid transparent; padding: 12px 8px; font-size: 12px; }
  .sidebar-item.active { border-bottom-color: #2e7d32; border-left-color: transparent; }
  .main { padding: 20px 16px; }
  .header { padding: 0 16px; }
  .top-nav { gap: 12px; }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .plan-grid  { grid-template-columns: 1fr 1fr; }
  .auth-box { padding: 28px 20px; }
}
