/* ===== 兜客域名分销系统 v2.0 共享样式 ===== */
* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f4f6fa; color: #1f2937; font-size: 14px; line-height: 1.6;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* 顶部导航 */
.nav-top { background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 50; }
.nav-top .inner { display: flex; align-items: center; height: 58px; gap: 24px; }
.nav-top .logo { font-weight: 700; font-size: 18px; color: #1e40af; }
.nav-top .menu { display: flex; gap: 18px; flex: 1; }
.nav-top .menu a { color: #374151; font-size: 14px; }
.nav-top .right { display: flex; gap: 12px; align-items: center; }

/* 按钮 */
.btn {
  display: inline-block; padding: 9px 18px; border: 1px solid #2563eb; background: #2563eb;
  color: #fff; border-radius: 6px; font-size: 14px; cursor: pointer; text-align: center;
}
.btn:hover { background: #1e40af; text-decoration: none; }
.btn-ghost { background: #fff; color: #2563eb; }
.btn-ghost:hover { background: #eff6ff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: #dc2626; border-color: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #16a34a; border-color: #16a34a; }
.btn-success:hover { background: #15803d; }

/* 卡片 / 区块 */
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px; margin: 16px 0; }
.section { padding: 36px 0; }
.hero { background: linear-gradient(135deg, #1e40af, #2563eb); color: #fff; padding: 56px 0; }
.hero h1 { font-size: 30px; margin: 0 0 10px; }
.hero p { opacity: .92; margin: 0 0 22px; }

/* 查询框 */
.search-box { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.15); max-width: 760px; }
.search-box .row { display: flex; gap: 10px; }
.search-box input[type=text] { flex: 1; padding: 13px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 16px; }
.search-box input:focus { outline: none; border-color: #2563eb; }
.tlds { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.tlds label { font-size: 13px; background: #f1f5f9; padding: 5px 10px; border-radius: 20px; cursor: pointer; border: 1px solid transparent; }
.tlds input { display: none; }
.tlds input:checked + span { color: #1e40af; font-weight: 600; }
.tlds label:has(input:checked) { border-color: #2563eb; background: #eff6ff; }

/* 结果列表 */
.result-list { margin-top: 16px; }
.result-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; background: #fff; }
.result-item .dm { font-size: 15px; font-weight: 600; color: #1f2937; }
.result-item .price { color: #dc2626; font-weight: 600; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; }
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-no { background: #fee2e2; color: #b91c1c; }
.badge-wait { background: #fef9c3; color: #a16207; }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* 价格表 */
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 14px; }
.price-card { border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; text-align: center; background: #fff; }
.price-card .tld { font-size: 18px; font-weight: 700; }
.price-card .num { font-size: 22px; color: #dc2626; margin: 8px 0; }
.price-card .price-sub { font-size: 13px; color: #6b7280; min-height: 18px; margin-bottom: 10px; line-height: 1.6; }
.price-card .price-sub span { display: inline-block; }
.price-card .price-sub span + span { margin-left: 8px; }

/* 表单 */
.form-wrap { max-width: 400px; margin: 40px auto; }
.form-wrap .card { padding: 26px; }
.form-wrap h2 { margin: 0 0 18px; font-size: 20px; text-align: center; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 5px; color: #4b5563; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit;
}
.form-group input:focus, .form-group select:focus { outline: none; border-color: #2563eb; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs a {
  flex: 1; text-align: center; padding: 10px; border-radius: 6px;
  background: #f8fafc; border: 1px solid #e2e8f0; color: #475569; font-size: 14px;
  font-weight: 500; cursor: pointer; transition: all .15s ease;
}
.tabs a:hover { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.tabs a.on { background: #2563eb; color: #fff; border-color: #2563eb; box-shadow: 0 1px 2px rgba(37,99,235,.2); }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 10px 14px; border-radius: 8px; margin: 14px 0; font-size: 13px; }
.sync-tip { background: #fff7ed; border: 1px solid #fed7aa; color: #c2410c; padding: 9px 14px; border-radius: 8px; margin: -6px 0 14px; font-size: 13px; font-weight: 600; text-align: center; }

/* 后台 / 会员 布局 */
.layout { display: flex; min-height: calc(100vh - 58px); }
.sidebar { width: 210px; background: #1f2937; color: #cbd5e1; flex-shrink: 0; padding: 16px 0; position: sticky; top: 58px; align-self: flex-start; height: calc(100vh - 58px); overflow-y: auto; }
.sidebar .ttl { padding: 10px 20px; font-size: 13px; color: #94a3b8; }
.sidebar a { display: block; padding: 11px 20px; color: #cbd5e1; font-size: 14px; border-left: 3px solid transparent; }
.sidebar a:hover, .sidebar a.on { background: #374151; color: #fff; text-decoration: none; border-left-color: #2563eb; }
.sidebar .exit { margin-top: 20px; padding: 11px 20px; color: #f87171; }
.main { flex: 1; padding: 24px; overflow: auto; }
.main h3 { margin: 0 0 16px; font-size: 18px; }
.panel { display: none; }
.panel.on { display: block; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* 表格 */
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 11px 12px; border-bottom: 1px solid #eef0f3; font-size: 13px; text-align: left; }
.table th { background: #f8fafc; color: #475569; font-weight: 600; }
.table tr:hover td { background: #fafbff; }
.empty { text-align: center; color: #9ca3af; padding: 30px 0; }

/* 表格滚动容器 + 冻结表头/首列 */
.table-scroll { max-height: calc(100vh - 260px); overflow: auto; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.table-scroll .table { border-radius: 0; }
.table thead th { position: sticky; top: 0; z-index: 10; background: #f8fafc; }
.table tbody td:first-child,
.table thead th:first-child { position: sticky; left: 0; z-index: 11; background: #fff; }
.table thead th:first-child { z-index: 12; background: #f8fafc; }

/* 新网成本价：表头固定，tbody 独立滚动（不依赖 sticky 兼容性） */
.xinnet-price-wrap { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; background: #fff; }
.xinnet-price-wrap .table { table-layout: fixed; width: 100%; border-collapse: collapse; border-radius: 0; }
.xinnet-price-wrap .table th,
.xinnet-price-wrap .table td { padding: 11px 12px; border-bottom: 1px solid #eef0f3; font-size: 13px; text-align: left; vertical-align: middle; }
.xinnet-price-wrap .table th { background: #f8fafc; color: #475569; font-weight: 600; }
.xinnet-price-wrap .table-header-fixed { background: #f8fafc; border-bottom: 1px solid #e5e7eb; }
.xinnet-price-wrap .table-scroll { max-height: calc(100vh - 310px); overflow: auto; border: none; border-radius: 0; background: #fff; }
.xinnet-price-wrap .table th:nth-child(1),
.xinnet-price-wrap .table td:nth-child(1) { width: 140px; }
.xinnet-price-wrap .table th:nth-child(2),
.xinnet-price-wrap .table td:nth-child(2),
.xinnet-price-wrap .table th:nth-child(3),
.xinnet-price-wrap .table td:nth-child(3),
.xinnet-price-wrap .table th:nth-child(4),
.xinnet-price-wrap .table td:nth-child(4) { width: calc((100% - 140px) / 3); }
.xinnet-price-wrap .table tbody td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }
.xinnet-price-wrap .table tbody tr:hover td { background: #fafbff; }
.xinnet-price-wrap .table tbody tr:hover td:first-child { background: #fafbff; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 18px; }
.stat .n { font-size: 26px; font-weight: 700; color: #1e40af; }
.stat .l { color: #6b7280; font-size: 13px; margin-top: 4px; }
footer { background: #1f2937; color: #9ca3af; text-align: center; padding: 22px; font-size: 13px; }
.msg { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 10px; }
.msg-err { background: #fde8e8; color: #c0392b; }
.msg-ok { background: #e7f7ec; color: #1a7f37; }
.msg-warn { background: #fff7ed; color: #c2410c; }
#toast { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 999; display: none; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 200; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 10px; padding: 22px; width: 420px; max-width: 92vw; max-height: 86vh; overflow: auto; }
.modal.wide { width: 760px; }
.modal h4 { margin: 0 0 14px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-header h4 { margin: 0; }
.modal-close { background: none; border: none; font-size: 18px; color: #6b7280; cursor: pointer; padding: 4px; line-height: 1; }
.modal-close:hover { color: #1f2937; }
.modal .actions { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; }
.tip { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* ===== 域名实名模板 ===== */
.whois-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.whois-filter { display: flex; flex-wrap: nowrap; gap: 10px; align-items: center; }
.whois-filter .filter-item { flex: 0 0 auto; }
.whois-filter .filter-item input,
.whois-filter .filter-item select { padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; }
.whois-filter .filter-item input { width: 220px; }
.whois-filter .filter-item select { width: 140px; }
.whois-filter .filter-item input:focus,
.whois-filter .filter-item select:focus { outline: none; border-color: #2563eb; }
.whois-filter .filter-btns { flex: 0 0 auto; display: flex; gap: 8px; margin-left: auto; }
.whois-table td { vertical-align: middle; }
.whois-table .link { color: #2563eb; font-size: 13px; margin-right: 10px; white-space: nowrap; }
.whois-table .link:hover { text-decoration: underline; }
.whois-table .link.muted { color: #9ca3af; cursor: default; }
.whois-table .link.muted:hover { text-decoration: none; }
.type-tag { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 12px; }
.type-p { background: #eff6ff; color: #1e40af; }
.type-c { background: #f0fdf4; color: #15803d; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green::before { background: #22c55e; }
.dot-blue::before { background: #3b82f6; }
.dot-red::before { background: #ef4444; }
.dot-gray::before { background: #9ca3af; }
.req { color: #dc2626; margin-right: 2px; }
.whois-form { font-size: 14px; }
.whois-form .form-group { margin-bottom: 14px; }
.whois-form .form-group label { display: block; font-size: 13px; color: #374151; margin-bottom: 5px; }
.whois-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.whois-form .form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.whois-notice { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; color: #1e40af; font-size: 13px; }
.whois-notice b { display: block; margin-bottom: 6px; }
.whois-notice p { margin: 4px 0; line-height: 1.5; }
.radio-group { display: flex; gap: 12px; }
.radio-box { flex: 1; display: inline-block; width: calc(50% - 6px); border: 1px solid #d1d5db; border-radius: 8px; padding: 12px; text-align: center; cursor: pointer; background: #fff; color: #374151; }
.radio-box input { display: none; }
.radio-box.on { border-color: #2563eb; background: #eff6ff; color: #1e40af; font-weight: 600; }
.upload-box { position: relative; border: 1px dashed #cbd5e1; border-radius: 8px; min-height: 120px; display: flex; align-items: center; justify-content: center; background: #f8fafc; cursor: pointer; overflow: hidden; }
.upload-box input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-tip { text-align: center; color: #6b7280; pointer-events: none; }
.upload-tip i { display: block; font-style: normal; font-size: 22px; color: #2563eb; margin-bottom: 4px; }
.upload-tip small { display: block; margin-top: 4px; font-size: 12px; }
.whois-detail { font-size: 14px; }
.whois-detail .detail-row { display: flex; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.whois-detail .detail-row span:first-child { width: 110px; color: #6b7280; flex-shrink: 0; }
.whois-detail .detail-row b { color: #1f2937; font-weight: 600; }

/* 上传/校验实名模板弹窗 */
.tpl-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.tpl-form .form-group { margin-bottom: 0; }
.tpl-form .fg-full { grid-column: 1 / -1; }
.tpl-section { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: #2563eb; border-top: 1px dashed #e5e7eb; padding-top: 10px; margin-top: 2px; }
.tpl-section:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.tip-light { color: #9ca3af; font-weight: 400; font-size: 12px; }


/* ===== 域名管理弹窗（会员自助） ===== */
.dm-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid #e5e7eb; padding-bottom: 10px; }
.tab-btn { padding: 6px 12px; border: 1px solid #e5e7eb; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; color: #374151; transition: all .15s; }
.tab-btn:hover { border-color: #93c5fd; }
.tab-btn.on { background: #2563eb; color: #fff; border-color: #2563eb; }
.dm-tab-body { margin-top: 14px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.dm-result { margin-top: 12px; }
.dm-raw { white-space: pre-wrap; word-break: break-all; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 6px; padding: 10px; font-size: 12px; line-height: 1.5; max-height: 280px; overflow: auto; margin: 0; }
.dm-card { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.dm-card .dm-bar { padding: 10px 14px; font-size: 14px; font-weight: 600; }
.dm-ok .dm-bar { background: #f0fdf4; color: #15803d; border-bottom: 1px solid #bbf7d0; }
.dm-err .dm-bar { background: #fef2f2; color: #b91c1c; border-bottom: 1px solid #fecaca; }
.dm-fields { padding: 6px 14px 10px; }
.dm-row { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.dm-row:last-child { border-bottom: none; }
.dm-k { width: 170px; flex-shrink: 0; color: #6b7280; word-break: break-all; }
.dm-v { color: #1f2937; font-weight: 600; word-break: break-all; flex: 1; }
.dm-raw-wrap { padding: 8px 14px 12px; }
.dm-raw-wrap summary { cursor: pointer; color: #2563eb; font-size: 13px; user-select: none; padding: 4px 0; }
.dm-raw-wrap summary:hover { text-decoration: underline; }
.dm-subcard { border: 1px solid #e5e7eb; border-radius: 6px; margin: 4px 0; overflow: hidden; }
.dm-subtitle { background: #f8fafc; padding: 6px 10px; font-size: 12px; font-weight: 600; color: #374151; border-bottom: 1px solid #eef2f7; }
.dm-subcard .dm-fields { padding: 6px 10px; }
.dm-subcard .dm-row { padding: 5px 0; font-size: 12px; }
.dm-subcard .dm-k { width: 130px; }
.dm-empty { color: #9ca3af; }
.tag-pending { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 12px; background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

/* 复审模板列表等友好表格 */
.table-wrap { max-height: 60vh; overflow: auto; border: 1px solid #e5e7eb; border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
.data-table th { position: sticky; top: 0; background: #f1f5f9; color: #475569; font-weight: 600; z-index: 1; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table td:last-child, .data-table th:last-child { white-space: normal; }
.empty-tip { color: #94a3b8; text-align: center; padding: 26px 0; font-size: 13px; }

/* ===== 域名详情页（DCP 风格） ===== */
.link-domain { color: #1e40af; font-weight: 600; cursor: pointer; }
.link-domain:hover { text-decoration: underline; }
.dd-head { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 20px; margin: 16px 0; }
.dd-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 16px; align-items: start; }
.dd-grid .card { margin: 0; }
.kv { width: 100%; border-collapse: collapse; }
.kv td { padding: 9px 8px; border-bottom: 1px solid #f1f3f6; font-size: 14px; vertical-align: top; }
.kv td.k { width: 96px; color: #6b7280; flex-shrink: 0; }
.kv td.v { color: #1f2937; font-weight: 500; word-break: break-all; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f3f6; }
.switch-row:last-child { border-bottom: none; }
.sw-text { flex: 1; }
.sw-title { font-size: 14px; font-weight: 500; color: #1f2937; }
.sw-desc { font-size: 12px; color: #6b7280; margin-top: 2px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; border-radius: 26px; transition: .2s; }
.switch .slider::before { content: ''; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: #2563eb; }
.switch input:checked + .slider::before { transform: translateX(20px); }
@media (max-width: 860px) { .dd-grid { grid-template-columns: 1fr; } }
