/* ==========================================================================
   远远广告联盟系统 - 前台现代化主题 modern.css
   现代、响应式、扁平化设计。用于前台（index/def）所有页面。
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --accent: #06b6d4;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --ink: #111827;
  --text: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f5f6fa;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, .06), 0 1px 2px rgba(17, 24, 39, .04);
  --shadow: 0 10px 30px rgba(17, 24, 39, .08);
  --shadow-lg: 0 24px 60px rgba(79, 70, 229, .18);
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 130%);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 老 style.css 用 `font: 12px/1.5 arial, Microsoft YaHei...` 给 form 单独设了
   12px，导致表单 / 按钮文字比正文小一号、字形也不一致，这里统一字阶与字体。 */
body, form, input, select, textarea, button, label {
  font-family: var(--font) !important;
}
form, input, select, textarea, button, label { font-size: var(--fs-base) !important; }

/* 老模板用 <font> 标记状态色：统一字号/字体，仅保留颜色语义 */
font { font-family: var(--font) !important; font-size: inherit !important; line-height: inherit !important; }
b, strong { font-weight: 700; }

/* 老主题提示 / 错误文字在 11~12px 之间跳动，统一为一档 */
.error_span, span.r_error { font-size: var(--fs-sm) !important; }
/* 老主题混用 Arial / Simsun 渲染数字，统一字体栈 */
.num1, .num2 { font-family: var(--font) !important; }

/* ---------- 状态徽标（与会员中心 / 后台保持一致） ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.75;
  white-space: nowrap;
  border: 1px solid transparent;
}
.tag-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.tag-danger  { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.tag-warning { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.tag-info    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.tag-muted   { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.tag-primary { background: var(--primary-light); color: var(--primary-dark); border-color: #c7d2fe; }
.req { color: #ef4444; font-weight: 700; }

a { color: var(--primary); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; border: 0; }
table { border-collapse: collapse; }
.red_dotted { background: none !important; }
.clear { clear: both; }
.gray9, .noMar { color: var(--muted); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: .2px;
  white-space: nowrap;
}
.site-header .brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--shadow-lg);
}
.site-header .brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 2px;
}
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}
.site-nav a:hover { background: var(--primary-light); color: var(--primary-dark); }
.site-nav a.current { background: var(--grad); color: #fff; box-shadow: var(--shadow-lg); }
.site-auth { display: flex; align-items: center; gap: 10px; }

.btn,
.btn_css,
input[type="submit"],
input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--grad);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
  box-shadow: var(--shadow-lg);
}
.btn:hover, .btn_css:hover, input[type="submit"]:hover, input[type="button"]:hover {
  transform: translateY(-1px);
  opacity: .95;
}
.btn-ghost, .btn-line {
  background: #fff !important;
  color: var(--primary) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow-sm);
}

/* ---------- 主容器 ---------- */
.page-wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 0; }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: var(--grad);
  color: #fff;
  padding: 56px 48px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 30px;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 200px at 90% -10%, rgba(255, 255, 255, .25), transparent),
    radial-gradient(400px 200px at -10% 120%, rgba(255, 255, 255, .18), transparent);
  pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center; position: relative; }
.hero h1 { margin: 0 0 14px; font-size: 40px; line-height: 1.2; letter-spacing: -.5px; }
.hero p { margin: 0 0 26px; font-size: 16px; opacity: .92; max-width: 520px; }
.hero .hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .btn-light { background: #fff !important; color: var(--primary) !important; }
.hero .btn-outline { background: rgba(255, 255, 255, .14) !important; color: #fff !important; box-shadow: none; border: 1px solid rgba(255, 255, 255, .5) !important; }
.hero-stats { display: flex; gap: 34px; margin-top: 34px; }
.hero-stats .num { font-size: 26px; font-weight: 800; }
.hero-stats .lbl { font-size: 13px; opacity: .85; }

/* ---------- 登录卡片 ---------- */
.login-card {
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .22);
  color: var(--text);
}
.login-card h3 { margin: 0 0 4px; font-size: 20px; color: var(--ink); }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafb;
  font-size: 14px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
.login-card .btn, .login-card input[type="submit"] { width: 100%; margin-top: 18px; height: 46px; }

/* ---------- 通用卡片 / 区块标题 ---------- */
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 18px;
}
.section-head .title, .title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-head .title::before, .title.section::before {
  content: "";
  width: 5px;
  height: 18px;
  border-radius: 4px;
  background: var(--grad);
}
.section-head a { font-size: 13px; }

/* 兼容旧标题分割线 */
.title_td_1 { height: 3px !important; background: var(--grad) !important; border-radius: 4px; }
.title_td_2 { background: var(--line) !important; height: 1px !important; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.feature-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #dbe0ff; }
.feature-card .fc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.feature-card .fc-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary-light); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; font-size: 20px;
}
.feature-card h4 { margin: 0; font-size: 16px; color: var(--ink); }
.feature-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }

/* 广告类型旧盒子 */
.box {
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
  padding: 6px 16px 16px;
}
.box_tit { font-size: 16px; font-weight: 800; color: var(--ink); }

/* 公告列表 */
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.notice-list li:last-child { border-bottom: 0; }
.notice-list .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex: none; }
.notice-list .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-list .d { color: var(--muted); font-size: 12.5px; }

/* ---------- 表单（注册/登录等） ---------- */
input[type="text"], input[type="password"], input[type="email"], select, textarea, .input_text {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  transition: border-color .16s, box-shadow .16s;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
select:focus, textarea:focus, .input_text:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}
.form_list { list-style: none; margin: 0; padding: 0; }
.form_list li { margin-bottom: 16px; }
.form_list label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 13px; }
.form_list .input_text { width: 100%; height: 44px; }
.tip { color: var(--danger); font-size: 12.5px; margin-top: 5px; display: none; }
.em-red, .red, em.red { color: var(--danger); font-style: normal; }

/* 注册页 */
.register { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 30px; }
.register h2 { font-size: 18px; color: var(--ink); margin: 22px 0 6px; padding-left: 12px; border-left: 4px solid var(--primary); }
.register .tip { display: block; color: var(--muted); font-size: 13px; }
.register .input_1 td { padding: 9px 6px; }
.register input.input_text { height: 40px; }
.tipinfo {
  border-radius: var(--radius-sm);
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 12px 16px;
  margin-bottom: 16px;
}

/* 步骤条 */
.step ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.step li { padding: 6px 16px; border-radius: 999px; background: var(--line); color: var(--muted); font-weight: 600; }
.step li.on { background: var(--grad); color: #fff; }

/* ---------- 提示消息页 ---------- */
.msg-box { max-width: 560px; margin: 70px auto; text-align: center; }
.msg-box .icon { font-size: 46px; }
.msg-box h2 { color: var(--ink); }

/* ---------- 页脚 ---------- */
.site-footer { background: #0f172a; color: #94a3b8; margin-top: 50px; padding: 44px 20px 26px; }
.site-footer .cols { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.site-footer h5 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.site-footer a { color: #94a3b8; display: block; padding: 5px 0; font-size: 13.5px; }
.site-footer a:hover { color: #fff; }
.site-footer .brand-line { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 17px; margin-bottom: 12px; }
.site-footer .cop { max-width: 1180px; margin: 28px auto 0; padding-top: 20px; border-top: 1px solid #1e293b; text-align: center; font-size: 13px; }
.footer { background: none !important; height: auto !important; }
.links, .links_1, .copyright { color: #94a3b8; }

/* ---------- 旧登录页兼容（login.tpl.php） ---------- */
.head { background: var(--grad); }
.head_box { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.head_list { display: flex; align-items: center; gap: 16px; height: 84px; }
.logo-title { color: #fff; font-size: 20px; font-weight: 700; margin: 0; }
.main { max-width: 1180px; margin: 0 auto; padding: 0 20px; display: flex; gap: 30px; flex-wrap: wrap; }
.left_list { flex: 1; min-width: 320px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: 30px; }
.right_login { width: 320px; }
.right_list { list-style: none; margin: 0; padding: 26px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.right_list li { margin-bottom: 14px; color: var(--muted); }
.intro_box { font-size: 16px; color: var(--ink); font-weight: 700; margin-bottom: 18px; }

/* ---------- 滚动条 & 通用细节 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #cfd4de;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #b6bccb; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- 数据表格 ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr { transition: background .15s; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .site-header .wrap { height: 58px; gap: 10px; padding: 0 14px; }
  .site-header .brand { font-size: 16px; }
  .site-header .brand small { display: none; }
  .site-nav {
    flex: 1;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; padding: 7px 12px; font-size: 13.5px; }
  .site-auth { gap: 6px; }
  .site-auth .btn { padding: 8px 14px; font-size: 13px; }
  .hero { padding: 40px 26px; }
  .hero h1 { font-size: 32px; }
  .page-wrap { padding: 20px 14px 0; }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero { padding: 32px 20px; border-radius: 18px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14.5px; }
  .hero-stats { gap: 20px; flex-wrap: wrap; }
  .hero-stats .num { font-size: 21px; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .right_login { width: 100%; }
  .card, .panel, .login-card, .register, .box { padding: 18px; }
}

/* ---------- 深色模式 ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ecf5;
    --text: #c3ccdb;
    --muted: #93a1b8;
    --line: #262c3d;
    --bg: #0b0f19;
    --card: #131826;
    --primary-light: #1e2440;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
  ::-webkit-scrollbar-thumb { background: #38415a; background-clip: content-box; }
  .site-header { background: rgba(19, 24, 38, .92); }
  .login-card, .feature-card, .box, .register, .left_list, .right_list,
  .card, .panel { background: var(--card) !important; }
  .feature-card:hover { border-color: #38415a; }
  .btn-ghost, .btn-line { background: var(--card) !important; }
  .login-card input[type="text"], .login-card input[type="password"],
  input[type="text"], input[type="password"], input[type="email"],
  select, textarea, .input_text { background: #0f1420; color: var(--text); }
  .login-card input:focus, input[type="text"]:focus, input[type="password"]:focus,
  input[type="email"]:focus, select:focus, textarea:focus { background: var(--card); }
  .table th { background: #0f1420; }
  .table-hover tbody tr:hover { background: #0f1420; }
  .tipinfo { background: #0d2a22; border-color: #14532d; color: #6ee7b7; }
  .step li { background: #1e2440; color: var(--muted); }
  .notice-list .dot { background: #6366f1; }
}
