/*
 * Nameremind UI system
 * One presentation layer for desktop, tablet and H5.
 * Business behavior remains in the existing templates and scripts.
 */
:root {
    --nmr-ink: #172033;
    --nmr-muted: #667085;
    --nmr-faint: #f6f7fb;
    --nmr-line: #e7eaf2;
    --nmr-primary: #635bff;
    --nmr-primary-dark: #4f46e5;
    --nmr-success: #16805c;
    --nmr-warning: #a15c00;
    --nmr-danger: #c2414b;
    --nmr-radius: 14px;
    --nmr-shadow: 0 8px 26px rgba(23,32,51,.06);
}

/* Product architecture: the legacy anonymous subscription remains available
 * to old handlers, but is not part of the primary public journey. */
#subscribe-section { display: none !important; }
.home-section:not(.home-search-section) { display:none !important; }
.home-opportunity-section { margin:1rem 0 2rem; padding:1rem; border:1px solid #e2e8f0; border-radius:1rem; background:#fff; box-shadow:0 10px 30px rgba(15,23,42,.05); }
.home-opportunity-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.75rem; }
.home-opportunity-head h2 { margin:.35rem 0 0; color:#0f172a; font-size:1.25rem; }
.home-opportunity-head a { color:#2563eb; font-size:.85rem; font-weight:700; text-decoration:none; white-space:nowrap; }
.home-opportunity-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.6rem; }
.home-opportunity-card { position:relative; display:flex; flex-direction:column; gap:.25rem; min-width:0; padding:.8rem .9rem; border:1px solid #e2e8f0; border-radius:.75rem; color:#172033; text-decoration:none; }
.home-opportunity-card strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.95rem; }
.home-opportunity-card span { color:#2563eb; font-size:.85rem; font-weight:700; }
.home-opportunity-card i { position:absolute; right:.7rem; bottom:.55rem; color:#94a3b8; font-size:1.15rem; font-style:normal; }
.nmr-mobile-bottom-nav { display:none; }
.home-start-panel { display:grid; grid-template-columns:minmax(220px,.85fr) minmax(0,1.7fr); gap:1.25rem; align-items:stretch; margin:1rem 0 1.5rem; padding:1.25rem; border:1px solid #e2e8f0; border-radius:1rem; background:#fff; box-shadow:0 10px 30px rgba(15,23,42,.05); }
.home-start-copy { display:flex; flex-direction:column; justify-content:center; padding:.5rem; }
.home-start-copy .section-tag { width:max-content; }
.home-start-copy h2 { margin:.65rem 0 .4rem; color:#0f172a; font-size:1.35rem; line-height:1.35; }
.home-start-copy p { margin:0; color:#64748b; line-height:1.65; }
.home-start-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; }
.home-start-card { display:flex; flex-direction:column; gap:.35rem; min-height:9rem; padding:1rem; border:1px solid #e2e8f0; border-radius:.85rem; background:#f8fafc; color:#0f172a; text-decoration:none; transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease; }
.home-start-card:hover { transform:translateY(-2px); border-color:#93c5fd; box-shadow:0 8px 20px rgba(37,99,235,.1); }
.home-start-card strong { font-size:1rem; line-height:1.4; }
.home-start-card > span:last-child { color:#64748b; font-size:.86rem; line-height:1.55; }
.home-start-index { color:#2563eb; font-size:.75rem; font-weight:700; letter-spacing:.08em; }
.home-start-card-accent { background:#eff6ff; border-color:#bfdbfe; }
.nmr-page-intro { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:1.25rem 0 1rem; padding:1.15rem 1.25rem; border:1px solid #dbeafe; border-radius:1rem; background:linear-gradient(135deg,#f8fbff,#eff6ff); }
.nmr-page-intro .section-tag { display:inline-flex; margin-bottom:.4rem; }
.nmr-page-intro h1 { margin:0 0 .35rem; color:#0f172a; font-size:clamp(1.35rem,2vw,1.85rem); line-height:1.25; }
.nmr-page-intro p { max-width:44rem; margin:0; color:#64748b; line-height:1.6; }
.nmr-intro-action { flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; min-height:2.6rem; padding:.65rem 1rem; border-radius:.65rem; background:#2563eb; color:#fff; font-size:.9rem; font-weight:700; text-decoration:none; white-space:nowrap; }
.nmr-intro-action:hover { background:#1d4ed8; color:#fff; }
@media (max-width:720px) {
  .home-start-panel { grid-template-columns:1fr; padding:1rem; }
  .home-start-grid { grid-template-columns:1fr; }
  .home-start-card { min-height:0; }
  .nmr-page-intro { align-items:flex-start; flex-direction:column; padding:1rem; }
  .nmr-intro-action { width:100%; }
}

html, body { max-width: 100%; overflow-x: hidden; }
body { color: var(--nmr-ink); background: #f7f8fb; }
.screen-reader-text { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.site-content { padding-top: 5.5rem; }
button, input, select, textarea { color: var(--nmr-ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--nmr-primary); outline-offset: 2px;
}

/* Global shell */
.site-header { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--nmr-line); }
.site-header-inner { max-width: 1280px; min-height: 68px; height: auto; padding: .75rem 1.25rem; }
.site-title { font-size: 1.45rem; letter-spacing: -.04em; }
.site-description { color: var(--nmr-muted); }
.main-navigation { min-width: 0; }
.nav-toggle-button { display: none; }
.hamburger { display: inline-flex; flex-direction: column; gap: 4px; }
.hamburger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--nmr-ink); }
#primary-menu { align-items: center; gap: .25rem; }
#primary-menu a { color: var(--nmr-muted); padding: .55rem .8rem; font-size: .9rem; }
#primary-menu a:hover, #primary-menu .current-menu-item > a { color: var(--nmr-primary-dark); background: #f0efff; }
.site-main { max-width: 1280px; margin: 0 auto; }

/* Public page frame */
.domain-page, .domain-app, .uc-wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.domain-app-header { align-items: center; margin-bottom: 1rem; }
.domain-app-header .title-area h2, .section-head h2, .uc-head h2 { color: var(--nmr-ink); letter-spacing: -.025em; }
.domain-app-header .title-area .update-info, .uc-head p { color: var(--nmr-muted); }
.panel-card, .domain-toolbar, .filter-panel-container, .domain-table-wrap, .uc-sidebar > *, .uc-tab-content > * {
    border-color: var(--nmr-line); border-radius: var(--nmr-radius); box-shadow: var(--nmr-shadow);
}
.domain-toolbar { padding: .8rem 1rem; gap: .65rem; }
.toolbar-left, .toolbar-right { gap: .5rem; }
.search-box input, .filter-select, .filter-panel input, .filter-panel select, .filter-panel textarea {
    border-color: #d9deea; border-radius: 10px; min-height: 42px;
}
.filter-panel-container { padding: 1rem; margin-bottom: 1rem; background: #fff; }
.filter-panel { padding: 0; box-shadow: none; border: 0; }
.domain-table-wrap { overflow-x: auto; background: #fff; }
.domain-table { min-width: 720px; }
.domain-table th { background: #f8f9fc; color: #566176; }
.domain-table tbody tr:hover { background: #f7f8ff; }
.domain-pagination { gap: .35rem; margin-top: 1rem; }
.domain-pagination button, .domain-pagination .page-num { min-height: 40px; border-radius: 9px; }
.button, .btn { min-height: 40px; border-radius: 10px; }
.button-primary, .btn-primary { background: var(--nmr-primary-dark); border-color: var(--nmr-primary-dark); }
.home-search-section { margin-top: 1rem !important; padding-top: 2.5rem !important; }
.home-search-section .search-form > div:first-child { min-width: 0; }
.home-search-section .search-form > div:nth-child(2) { padding: 0 .35rem; }
.home-search-section .search-form > div:nth-child(2) a { display: block; white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.45; font-size: .78rem; }

/* Admin control room */
.admin-panel { max-width: 1440px; padding: 1.25rem; gap: 1.25rem; }
.admin-sidenav { border-color: var(--nmr-line); border-radius: var(--nmr-radius); box-shadow: var(--nmr-shadow); }
.admin-sidenav a.active { background: var(--nmr-primary-dark); }
.admin-main { min-width: 0; }
.panel-header-container { padding: .25rem 0; }
.panel-header-container h1 { font-size: clamp(1.35rem, 2vw, 1.85rem); color: var(--nmr-ink); letter-spacing: -.03em; }
.panel-header-container p { color: var(--nmr-muted); }
.status-bar { border-color: #cfe5f5; border-radius: var(--nmr-radius); box-shadow: var(--nmr-shadow); }
.status-value { overflow-wrap: anywhere; }
.status-cards { gap: .85rem !important; }
.status-cards > * { border-radius: var(--nmr-radius) !important; box-shadow: var(--nmr-shadow); }
.setting-card { border-color: var(--nmr-line); border-radius: var(--nmr-radius); overflow: hidden; }
.card-title { color: var(--nmr-ink); }
.card-body { min-width: 0; }
.sync-status-table { min-width: 620px; }

/* Account area */
.uc-wrap { padding-top: 1.5rem; }
.uc-grid { gap: 1.25rem; }
.uc-sidebar, .uc-main { min-width: 0; }
.uc-tabs { gap: .2rem; scrollbar-width: thin; }
.uc-tab { min-height: 44px; padding: .65rem .8rem; white-space: nowrap; }
.uc-stat { border-color: var(--nmr-line); border-radius: 10px; }
.phase4-filter-card { border-color: var(--nmr-line) !important; border-radius: 12px !important; box-shadow: var(--nmr-shadow); }

/* Consistent popups and forms */
.modal-overlay, .nmr-save-filter-overlay { padding: 1rem; }
.modal-content, .nmr-save-filter-dialog { border-radius: 16px; box-shadow: 0 20px 60px rgba(23,32,51,.2); }
.modal-header, .modal-footer { padding: .9rem 1rem; }

/* RiPro account pages: keep the commercial login shell, refine its product presentation */
.login-and-register { min-height: 100vh; background: radial-gradient(circle at 20% 10%, #e8e7ff 0, transparent 36%), linear-gradient(145deg, #eef2ff, #f8fafc 58%, #f5f3ff); }
.login-and-register .container { min-height: 100vh; }
.login-and-register .col-12 > .bg-white { width: 100%; max-width: 460px; margin: 1.5rem auto !important; border: 1px solid var(--nmr-line); box-shadow: 0 22px 60px rgba(23,32,51,.12) !important; }
.login-and-register .account-from input { min-height: 44px; border-radius: 10px; border-color: #d9deea; }
.login-and-register .account-from input[type="checkbox"] { width: 1rem !important; height: 1rem !important; min-height: 1rem; margin: 0 .35rem 0 0; accent-color: var(--nmr-primary); appearance: auto; }
.login-and-register .account-from button, .login-and-register .account-from .btn { min-height: 44px; border-radius: 10px; }
.login-and-register .text-muted { color: var(--nmr-muted) !important; }
.login-and-register a.text-center { display: block; text-decoration: none; }
.login-and-register a.text-center img.logo { display: block !important; width: auto; max-width: 180px; height: auto; margin: 0 auto .5rem; }

@media (max-width: 900px) {
    .site-header-inner { align-items: center; flex-wrap: wrap; }
    .site-branding { flex: 1; min-width: 0; }
    .nav-toggle-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--nmr-line); border-radius: 10px; background: #fff; cursor: pointer; }
    .nav-toggle-button .screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
    .main-navigation { display: none; flex: 0 0 100%; width: 100%; }
    #nav-toggle:checked ~ .main-navigation { display: block; }
    #primary-menu { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .35rem; padding-top: .5rem; }
    #primary-menu a { display: flex; justify-content: center; align-items: center; min-height: 40px; padding: .45rem .3rem; text-align: center; font-size: .82rem; }
    .domain-page, .domain-app, .uc-wrap { padding: 1rem .85rem 2rem; }
    .admin-panel { padding: 1rem .85rem 2rem; }
    .admin-sidenav { position: sticky; top: .5rem; z-index: 10; width: 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .admin-sidenav::-webkit-scrollbar { display: none; }
    .admin-sidenav-title, .admin-sidenav-foot { display: none; }
    .admin-sidenav a { white-space: nowrap; flex: 0 0 auto; }
    .uc-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    body { padding-bottom:4.75rem; }
    .site-footer { padding-bottom:5rem; }
    .home-opportunity-section { margin:1rem 0 1.25rem; padding:.9rem; }
    .home-opportunity-head { align-items:flex-end; }
    .home-opportunity-head h2 { font-size:1.1rem; }
    .home-opportunity-list { grid-template-columns:1fr; gap:.5rem; }
    .home-opportunity-card { min-height:3.2rem; justify-content:center; padding:.65rem 2rem .65rem .8rem; }
    .nmr-mobile-bottom-nav { position:fixed; right:0; bottom:0; left:0; z-index:1000; display:grid; grid-template-columns:repeat(4,1fr); padding:.4rem .5rem calc(.4rem + env(safe-area-inset-bottom)); border-top:1px solid #e2e8f0; background:rgba(255,255,255,.97); box-shadow:0 -8px 24px rgba(15,23,42,.1); }
    .nmr-mobile-bottom-nav a { display:flex; min-height:3.1rem; flex-direction:column; align-items:center; justify-content:center; gap:.12rem; border-radius:.65rem; color:#64748b; text-decoration:none; }
    .nmr-mobile-bottom-nav a span { display:block; height:1.1rem; font-size:1.05rem; font-weight:700; line-height:1; }
    .nmr-mobile-bottom-nav a small { font-size:.7rem; line-height:1; }
    .nmr-mobile-bottom-nav a.is-active { color:#245bdb; background:#eff6ff; }
    #primary-menu { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .site-title { font-size: 1.3rem; }
    .site-content { padding-top: 7.25rem; }
    .home-search-section { padding: 2.5rem 1rem 1.25rem !important; }
    .home-search-section .search-form > div:first-child { display: grid !important; grid-template-columns: minmax(0,1fr) auto !important; gap: .4rem !important; }
    .home-search-section #home-search-input { width: 100% !important; min-width: 0 !important; }
    .home-search-section #home-search-btn { min-width: 76px; padding-left: .75rem !important; padding-right: .75rem !important; }
    .domain-app-header { display: block; }
    .domain-app-header .actions, .domain-app-header .title-area { width: 100%; }
    .domain-toolbar { display: block; padding: .75rem; }
    .toolbar-left, .toolbar-right { display: grid; grid-template-columns: 1fr 1fr; margin-top: .55rem; }
    .toolbar-left:first-child, .toolbar-right:first-child { margin-top: 0; }
    .search-box, .search-box input, .toolbar-left > :first-child { width: 100%; min-width: 0; }
    .filter-panel-container { padding: .8rem; }
    .tabs-nav { margin: -.8rem -.8rem .75rem; padding: .7rem .8rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .tabs-ul { display:flex; flex-wrap:nowrap; width:max-content; gap:.35rem; }
    .tabs-ul li { flex:0 0 auto; }
    .cha-box { display:block; }
    .cha-list { gap:.55rem; }
    .cha-title { display:block; width:100%; margin-left:0 !important; }
    .quick-wrap { display:flex; flex-wrap:wrap; align-items:center; gap:.45rem; }
    .filter-panel .picker-wrapper, .filter-panel .filter-price-inp { max-width:100%; }
    .cha-submit, .cha-reset, .btn-save-settings { display:block; width:100%; }
    .cha-submit .btn, .cha-reset .btn, .btn-save-settings { width:100%; min-height:44px; text-align:center; }
    .filter-summary-bar { position:sticky; bottom:.5rem; z-index:5; display:flex; align-items:center; gap:.5rem; margin:.75rem -.1rem -.1rem; padding:.65rem .75rem; border:1px solid #dbeafe; border-radius:12px; background:rgba(239,246,255,.96); box-shadow:0 8px 24px rgba(15,23,42,.12); }
    .filter-summary-bar .summary-text { min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .filter-summary-bar .summary-clear-link { flex:0 0 auto; }
    .filter-bar, .form-row { gap: .65rem; }
    .filter-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
    .filter-actions .button, .filter-actions .btn { width: 100%; }
    .status-bar { grid-template-columns: 1fr !important; padding: .8rem; gap: .65rem; }
    .status-cards { grid-template-columns: 1fr !important; }
    .status-cards > * { grid-column: auto !important; }
    .card-body { padding: .85rem; }
    .card-title { padding: .8rem .85rem; font-size: .95rem; }
    .sync-actions, .form-actions, .log-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
    .sync-actions .btn, .form-actions .btn, .log-actions .btn { width: 100%; min-height: 44px; }
    .uc-head { margin-bottom: 1rem; }
    .uc-tabs { overflow-x: auto; margin: 0 -.85rem; padding: 0 .85rem; }
    .uc-tab { flex: 0 0 auto; }
    .uc-stats { grid-template-columns: repeat(3, minmax(0,1fr)); gap: .4rem; }
    .uc-stat { padding: .65rem .45rem; text-align: center; }
    .uc-stat-num { font-size: 1rem; }
    .uc-stat-lbl { font-size: .68rem; }
    .modal-content, .nmr-save-filter-dialog { width: calc(100vw - 1.2rem); max-height: calc(100vh - 1.2rem); overflow-y: auto; }
    .pricing-options { flex-direction: column; }
    .pricing-options .pricing-card { max-width: none; }
}

@media (max-width: 420px) {
    .toolbar-left, .toolbar-right, .filter-actions, .sync-actions, .form-actions, .log-actions { grid-template-columns: 1fr; }
    .uc-stats { grid-template-columns: 1fr 1fr 1fr; }
    .domain-table-wrap { overflow:visible; background:transparent; }
    .domain-table { display:block; min-width:0; width:100%; }
    .domain-table thead { display:none; }
    .domain-table tbody, .domain-table tr { display:block; }
    .domain-table tbody tr:not(.tfooter) { margin-bottom:.75rem; padding:.75rem; border:1px solid #e2e8f0; border-radius:14px; background:#fff; box-shadow:0 6px 18px rgba(15,23,42,.05); }
    .domain-table tbody tr:not(.tfooter) td { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; width:100%; min-height:34px; padding:.45rem 0; border:0; border-bottom:1px solid #f1f5f9; text-align:right; white-space:normal; }
    .domain-table tbody tr:not(.tfooter) td:last-child { border-bottom:0; }
    .domain-table tbody tr:not(.tfooter) td::before { content:attr(data-label); flex:0 0 auto; color:#64748b; font-size:.78rem; line-height:1.4; text-align:left; }
    .domain-table tbody tr:not(.tfooter) td.check-cell { display:flex; justify-content:flex-end; min-height:28px; padding:0 0 .25rem; border-bottom:0; }
    .domain-table tbody tr:not(.tfooter) td.check-cell::before { content:'选择'; margin-right:auto; }
    .domain-table tbody tr:not(.tfooter) td.domain-name-cell { display:block; padding-top:.1rem; text-align:left; }
    .domain-table tbody tr:not(.tfooter) td.domain-name-cell::before { display:none; }
    .domain-table tbody tr.tfooter { display:block; padding:.5rem 0; }
    .domain-table tbody tr.tfooter td { display:block; width:100%; overflow:auto; border:0; }
    .domain-table tbody tr:not(.tfooter) td.action-btns { justify-content:flex-end; padding-top:.65rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
