:root {
    --red: #8f1d18;
    --deep-red: #61110f;
    --gold: #d9aa4c;
    --light-gold: #f6e3b0;
    --ink: #2b1814;
    --muted: #7b6257;
    --paper: #fffaf0;
    --line: rgba(143, 29, 24, 0.16);
    --shadow: 0 18px 45px rgba(65, 18, 12, 0.14);
    --result-panel-height: clamp(620px, calc(100vh - 118px), 780px);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background:
        linear-gradient(180deg, rgba(255, 250, 240, 0.96), rgba(255, 244, 219, 0.92)),
        url("../images/banner.jpg") center top / cover fixed;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px clamp(18px, 4vw, 56px);
    background: rgba(97, 17, 15, 0.94);
    color: #fff8df;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.brand img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(246, 227, 176, 0.75);
}

.site-header nav {
    display: flex;
    gap: 18px;
    font-size: 14px;
    white-space: nowrap;
}

.site-header nav a {
    opacity: 0.9;
}

.site-header nav a:hover {
    color: var(--light-gold);
}

main {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.7fr);
    align-items: center;
    gap: clamp(28px, 5vw, 72px);
    padding: clamp(60px, 9vw, 120px) 0 48px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--red);
    font-weight: 700;
}

.hero h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 72px);
    line-height: 1.06;
    font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
    color: var(--deep-red);
}

.hero p {
    margin: 24px 0 0;
    max-width: 680px;
    color: #5d4339;
    font-size: 18px;
    line-height: 1.9;
}

.hero-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    background: linear-gradient(135deg, #b52d23, #7b1713);
    color: #fff8df;
    box-shadow: 0 10px 24px rgba(143, 29, 24, 0.26);
}

.btn.ghost {
    border-color: rgba(143, 29, 24, 0.32);
    color: var(--deep-red);
    background: rgba(255, 250, 240, 0.72);
}

.btn.soft {
    border-color: rgba(143, 29, 24, 0.2);
    color: var(--deep-red);
    background: #fff7e7;
}

.hero-panel,
.tool,
.analysis,
.orders {
    background: rgba(255, 250, 240, 0.92);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: 28px;
}

.hero-panel strong {
    display: block;
    margin-bottom: 18px;
    color: var(--deep-red);
    font-size: 22px;
}

.hero-panel ul {
    margin: 0;
    padding-left: 20px;
    color: #634a3f;
    line-height: 2;
}

.tool,
.analysis,
.orders {
    margin: 28px 0;
    padding: clamp(24px, 4vw, 42px);
}

.section-title {
    margin-bottom: 24px;
}

.section-title h2 {
    margin: 0;
    color: var(--deep-red);
    font-size: clamp(26px, 4vw, 38px);
    font-family: Georgia, "Times New Roman", "Microsoft YaHei", serif;
}

.section-title p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.name-form {
    display: grid;
    gap: 22px;
}

.form-note {
    margin: -4px 0 0;
    padding: 12px 14px;
    border: 1px solid rgba(143, 29, 24, 0.12);
    border-radius: 4px;
    background: #fff7e7;
    color: #7b6257;
    line-height: 1.7;
    font-size: 14px;
}

.lunar-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    padding: 14px;
    border: 1px solid rgba(143, 29, 24, 0.12);
    border-radius: 8px;
    background: #fff7e7;
}

.lunar-fields[hidden] {
    display: none;
}

.solar-date-field[hidden] {
    display: none !important;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(143, 29, 24, 0.16);
    border-radius: 4px;
    background: #fffdf7;
    color: #60463c;
    font-weight: 700;
}

.check-line input {
    width: 16px;
    min-height: 16px;
    padding: 0;
    accent-color: var(--deep-red);
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

label,
.field-group {
    display: grid;
    gap: 8px;
    color: #5b342b;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(143, 29, 24, 0.22);
    border-radius: 4px;
    background: #fffdf7;
    color: var(--ink);
    font: inherit;
    padding: 10px 12px;
    outline: none;
}

textarea {
    resize: vertical;
    line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(217, 170, 76, 0.18);
}

.segmented {
    display: inline-flex;
    width: fit-content;
    padding: 4px;
    background: #f4e4bd;
    border: 1px solid rgba(143, 29, 24, 0.16);
    border-radius: 4px;
}

.segmented button {
    min-width: 92px;
    border: 0;
    border-radius: 3px;
    padding: 10px 16px;
    background: transparent;
    color: #70453a;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.segmented button.active {
    background: var(--deep-red);
    color: #fff8df;
}

.wide-field {
    grid-column: 1 / -1;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.check-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(143, 29, 24, 0.16);
    border-radius: 4px;
    background: #fffdf7;
    color: #5f463b;
    font-size: 14px;
    font-weight: 700;
}

.check-grid input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--deep-red);
    padding: 0;
}

.analysis-panel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 12px;
    margin-bottom: 24px;
}

.analysis-item,
.analysis-more,
.name-card,
.order-card {
    border: 1px solid var(--line);
    background: rgba(255, 253, 247, 0.96);
    border-radius: 8px;
}

.analysis-item {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 96px;
    padding: 15px 16px;
}

.analysis-item.wide {
    grid-column: span 2;
}

.analysis-item.compact span {
    color: var(--deep-red);
    font-weight: 800;
}

.analysis-item strong {
    display: block;
    margin-bottom: 0;
    color: var(--red);
    font-size: 13px;
    line-height: 1.4;
}

.analysis-item span {
    display: block;
    color: #5f463b;
    line-height: 1.72;
    word-break: break-word;
}

.analysis-more {
    grid-column: 1 / -1;
    overflow: hidden;
}

.analysis-more summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    color: var(--deep-red);
    cursor: pointer;
    font-weight: 800;
}

.analysis-more summary:hover {
    background: #fff4dc;
}

.analysis-more summary em {
    color: #7a4d22;
    font-size: 12px;
    font-style: normal;
}

.analysis-more-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 16px 16px;
    border-top: 1px solid rgba(143, 29, 24, 0.1);
}

.analysis-more-grid div {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(143, 29, 24, 0.1);
    border-radius: 6px;
    background: #fff8ea;
}

.analysis-more-grid strong {
    color: var(--red);
    font-size: 13px;
}

.analysis-more-grid span {
    color: #60463c;
    line-height: 1.7;
}

.name-results {
    display: grid;
    gap: 16px;
}

.name-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff7e7;
}

.name-toolbar strong {
    display: block;
    color: var(--deep-red);
    font-size: 18px;
}

.name-toolbar span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.quick-save-guide {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(217, 170, 76, 0.38);
    border-radius: 8px;
    background: #fff3d6;
    color: #6f4635;
}

.quick-save-guide strong {
    color: var(--deep-red);
    white-space: nowrap;
}

.quick-save-guide span {
    font-size: 14px;
    line-height: 1.65;
}

.quick-save-guide a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    color: #fff8df;
    background: var(--deep-red);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.name-browser {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 1.05fr);
    gap: 18px;
    align-items: stretch;
}

.name-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 10px;
    position: sticky;
    top: 92px;
    height: var(--result-panel-height);
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.82);
    box-shadow: inset 0 0 0 1px rgba(255, 253, 247, 0.65);
    scrollbar-gutter: stable;
}

.name-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 48px;
    padding: 8px 10px;
    border: 1px solid rgba(143, 29, 24, 0.16);
    border-radius: 6px;
    background: #fffdf7;
    color: var(--ink);
    text-align: left;
}

.name-option:hover,
.name-option.active {
    border-color: var(--gold);
    background: #f8e8bd;
}

.name-pick {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.name-option span {
    min-width: 0;
    color: var(--deep-red);
    font-weight: 800;
}

.name-option em {
    flex: 0 0 auto;
    color: #7a4d22;
    font-style: normal;
    font-size: 12px;
}

.quick-favorite {
    align-self: center;
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid rgba(143, 29, 24, 0.18);
    border-radius: 999px;
    color: var(--red);
    background: #fff7e7;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.quick-favorite.saved {
    color: #7a4d22;
    border-color: rgba(217, 170, 76, 0.52);
    background: #f4e4bd;
}

.name-detail {
    position: sticky;
    top: 92px;
    min-height: var(--result-panel-height);
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.98);
    box-shadow: 0 12px 30px rgba(65, 18, 12, 0.1);
}

.detail-rank {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #f4e4bd;
    color: #7a4d22;
    font-size: 13px;
    font-weight: 700;
}

.name-detail h3 {
    margin: 0;
    color: var(--deep-red);
    font-size: 42px;
    letter-spacing: 0;
}

.name-score {
    display: inline-flex;
    margin: 12px 0;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f5dfac;
    color: #6f310f;
    font-weight: 700;
    font-size: 13px;
}

.score-breakdown {
    display: grid;
    gap: 8px;
    margin: 4px 0 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff8ea;
}

.score-row {
    display: grid;
    grid-template-columns: 92px 1fr 42px;
    align-items: center;
    gap: 10px;
    color: #60463c;
    font-size: 13px;
}

.score-row span {
    font-weight: 700;
}

.score-row em {
    color: #7a4d22;
    font-style: normal;
    text-align: right;
}

.score-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eed8a4;
}

.score-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8f1d18, #d9aa4c);
}

.name-detail p {
    margin: 0 0 10px;
    color: #60463c;
    line-height: 1.8;
}

.name-detail .detail-note {
    padding: 10px 12px;
    border-left: 3px solid var(--gold);
    background: #fff8ea;
}

.ns-panel {
    display: grid;
    gap: 14px;
    margin: 16px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff8ea;
}

.ns-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ns-head strong,
.ns-panel > strong {
    color: var(--deep-red);
}

.ns-head span {
    flex: 0 0 auto;
    color: #7a4d22;
    font-size: 13px;
    font-weight: 700;
}

.ns-char-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 6px;
    background: #fffdf7;
    font-size: 13px;
}

.ns-char-table th,
.ns-char-table td {
    padding: 8px;
    border: 1px solid rgba(143, 29, 24, 0.12);
    text-align: center;
}

.ns-char-table th {
    color: var(--red);
    background: #f4e4bd;
}

.ns-grid-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ns-grid-list li {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(143, 29, 24, 0.12);
    border-radius: 6px;
    background: #fffdf7;
}

.ns-grid-list span {
    color: var(--muted);
    font-size: 12px;
}

.ns-grid-list strong {
    color: var(--deep-red);
    font-size: 22px;
}

.ns-grid-list em {
    color: #7a4d22;
    font-size: 12px;
    font-style: normal;
}

.ns-explains,
.ns-talent {
    display: grid;
    gap: 8px;
}

.ns-explains details,
.ns-talent {
    border: 1px solid rgba(143, 29, 24, 0.12);
    border-radius: 8px;
    background: #fffdf7;
    overflow: hidden;
}

.ns-explains summary,
.ns-talent summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    color: var(--deep-red);
    cursor: pointer;
    font-weight: 700;
    line-height: 1.45;
}

.ns-explains summary:hover,
.ns-talent summary:hover {
    background: #fff4dc;
}

.ns-explains summary span,
.ns-talent summary span {
    min-width: 0;
}

.ns-explains summary em,
.ns-talent summary em {
    flex: 0 0 auto;
    color: #7a4d22;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
}

.ns-detail-body {
    display: grid;
    gap: 8px;
    padding: 0 14px 14px;
    border-top: 1px solid rgba(143, 29, 24, 0.1);
    background: linear-gradient(180deg, #fffaf0, #fffdf7);
}

.ns-detail-body p {
    margin: 0;
    padding: 10px 0 0;
    color: #60463c;
    line-height: 1.85;
    text-align: left;
}

.culture-panel,
.radar-panel,
.literary-panel,
.quality-panel,
.homophone-panel,
.scene-panel,
.nickname-panel,
.copy-panel,
.similar-panel {
    display: grid;
    gap: 10px;
    margin: 12px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff8ea;
}

.culture-panel > strong,
.radar-panel > strong,
.literary-panel > strong,
.quality-panel > strong,
.homophone-panel > strong,
.scene-panel > strong,
.nickname-panel > strong,
.copy-panel > strong,
.similar-panel > strong {
    color: var(--deep-red);
}

.culture-panel div,
.literary-panel div,
.homophone-panel div,
.scene-panel div {
    display: grid;
    gap: 8px;
}

.culture-panel span,
.literary-panel span,
.homophone-panel span,
.scene-panel span {
    display: block;
    color: #60463c;
    line-height: 1.75;
}

.culture-panel b,
.literary-panel b,
.homophone-panel b,
.scene-panel b,
.similar-panel b {
    color: var(--red);
    margin-right: 6px;
}

.radar-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    align-items: center;
}

.radar-panel svg {
    width: 220px;
    height: 220px;
}

.radar-panel circle,
.radar-panel line {
    fill: none;
    stroke: rgba(143, 29, 24, 0.14);
    stroke-width: 1;
}

.radar-panel polygon {
    fill: rgba(181, 45, 35, 0.2);
    stroke: var(--red);
    stroke-width: 2;
}

.radar-list {
    display: grid;
    gap: 9px;
}

.radar-list div {
    display: grid;
    grid-template-columns: 72px 1fr 34px;
    align-items: center;
    gap: 10px;
}

.radar-list span,
.radar-list em {
    color: #60463c;
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
}

.radar-list i {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #ead9b8;
}

.radar-list b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #d9aa4c, #b52d23);
}

.literary-panel article,
.homophone-panel article {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(143, 29, 24, 0.12);
    border-radius: 8px;
    background: #fffdf7;
}

.literary-panel article {
    grid-template-columns: auto 1fr;
}

.literary-panel article p,
.homophone-panel article p {
    grid-column: 1 / -1;
    margin: 0;
    color: #60463c;
    line-height: 1.7;
}

.literary-panel em {
    color: #7a4d22;
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
}

.homophone-panel div {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.homophone-panel article span {
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f4e4bd;
    color: #7a4d22;
    font-size: 12px;
    font-weight: 700;
}

.homophone-panel article.good span {
    background: #e7efd9;
    color: #4f641f;
}

.homophone-panel article.warn span {
    background: #f7dfc9;
    color: #8a3a10;
}

.quality-panel div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.quality-panel article {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(143, 29, 24, 0.12);
    border-radius: 8px;
    background: #fffdf7;
}

.quality-panel article span {
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f4e4bd;
    color: #7a4d22;
    font-size: 12px;
    font-weight: 700;
}

.quality-panel article.good span {
    background: #e7efd9;
    color: #4f641f;
}

.quality-panel article.warn span {
    background: #f7dfc9;
    color: #8a3a10;
}

.quality-panel article b {
    color: var(--deep-red);
}

.quality-panel article p {
    margin: 0;
    color: #60463c;
    line-height: 1.7;
}

.nickname-panel div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nickname-panel span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(143, 29, 24, 0.12);
    border-radius: 999px;
    background: #fffdf7;
    color: var(--deep-red);
    font-weight: 700;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.copy-panel {
    align-items: start;
}

.copy-panel p {
    margin: 0;
    color: #60463c;
    line-height: 1.75;
}

.similar-panel p {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 8px;
    margin: 0;
    padding: 8px 0;
    border-top: 1px solid rgba(143, 29, 24, 0.1);
}

.similar-panel p:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.similar-panel span {
    color: #60463c;
    line-height: 1.9;
}

.similar-panel em {
    display: inline-flex;
    margin: 0 4px 0 2px;
    padding: 1px 5px;
    border-radius: 999px;
    background: #f4e4bd;
    color: #7a4d22;
    font-style: normal;
    font-size: 11px;
}

.name-detail button {
    margin-top: 8px;
}

.empty-state {
    min-height: 120px;
    display: grid;
    place-items: center;
    color: var(--muted);
    border: 1px dashed rgba(143, 29, 24, 0.28);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.75);
}

.query-box {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    max-width: 780px;
}

.favorite-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.favorite-empty {
    padding: 16px;
    border: 1px dashed rgba(143, 29, 24, 0.24);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 253, 247, 0.78);
}

.favorite-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff7e7;
}

.favorite-head strong {
    color: var(--deep-red);
    font-size: 18px;
}

.favorite-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.favorite-card {
    position: relative;
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.96);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.favorite-card:hover {
    border-color: rgba(217, 170, 76, 0.62);
    box-shadow: 0 12px 28px rgba(65, 18, 12, 0.12);
    transform: translateY(-1px);
}

.favorite-card .favorite-name {
    color: var(--deep-red);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.2;
}

.favorite-card span {
    color: #7a4d22;
    font-weight: 700;
    font-size: 12px;
}

.favorite-card p {
    margin: 0;
    color: #634a3f;
    line-height: 1.55;
    font-size: 13px;
}

.favorite-card button {
    justify-self: start;
    border: 0;
    padding: 0;
    color: var(--red);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.favorite-card button:hover {
    color: var(--deep-red);
}

.favorite-tip {
    position: fixed;
    z-index: 50;
    display: grid;
    gap: 8px;
    width: min(380px, calc(100vw - 32px));
    max-height: min(520px, calc(100vh - 24px));
    overflow: auto;
    padding: 18px 18px 16px;
    border: 1px solid rgba(217, 170, 76, 0.55);
    border-radius: 8px;
    background: #fffaf0;
    box-shadow: 0 18px 42px rgba(65, 18, 12, 0.22);
}

.favorite-tip button {
    position: absolute;
    top: 8px;
    right: 10px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.favorite-tip strong {
    color: var(--deep-red);
    font-size: 30px;
    line-height: 1.2;
}

.favorite-tip span {
    color: #7a4d22;
    font-weight: 800;
}

.favorite-tip p {
    margin: 0;
    color: #60463c;
    line-height: 1.7;
}

.favorite-tip b {
    color: var(--red);
}

.favorite-compare {
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 247, 0.96);
}

.favorite-compare > strong {
    display: block;
    margin-bottom: 12px;
    color: var(--deep-red);
    font-size: 18px;
}

.favorite-compare table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    font-size: 13px;
}

.favorite-compare th,
.favorite-compare td {
    padding: 10px;
    border: 1px solid rgba(143, 29, 24, 0.12);
    text-align: left;
    vertical-align: top;
}

.favorite-compare th {
    color: var(--red);
    background: #f4e4bd;
}

.favorite-compare td {
    color: #60463c;
    line-height: 1.6;
}

.favorite-compare small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    line-height: 1.5;
}

.compare-meter {
    display: grid;
    grid-template-columns: 1fr 30px;
    align-items: center;
    gap: 7px;
}

.compare-meter i {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #ead9b8;
}

.compare-meter i::before {
    content: "";
    display: block;
    width: var(--meter, 100%);
    height: 100%;
}

.compare-meter i {
    background:
        linear-gradient(90deg, #d9aa4c, #b52d23) left center / var(--meter-width, 0%) 100% no-repeat,
        #ead9b8;
}

.compare-meter i[style] {
    background:
        linear-gradient(90deg, #d9aa4c, #b52d23) left center / 100% 100% no-repeat,
        #ead9b8;
}

.compare-meter span {
    color: var(--deep-red);
    font-weight: 800;
}

.order-list {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.order-card {
    padding: 18px;
}

.order-card strong {
    color: var(--deep-red);
}

.order-card p {
    margin: 8px 0 0;
    color: #634a3f;
    line-height: 1.7;
}

footer {
    padding: 34px 16px 48px;
    text-align: center;
    color: #fff8df;
    background: var(--deep-red);
    margin-top: 48px;
}

footer p {
    margin: 8px 0;
}

@media (max-width: 920px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-header nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .field-grid,
    .analysis-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lunar-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .favorite-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .check-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analysis-item.wide {
        grid-column: span 1;
    }

    .name-browser {
        grid-template-columns: 1fr;
    }

    .radar-layout {
        grid-template-columns: 1fr;
    }

    .name-list {
        position: static;
        height: auto;
        min-height: 520px;
        max-height: 620px;
    }

    .name-detail {
        position: static;
        min-height: 0;
    }
}

@media (max-width: 620px) {
    main {
        width: min(100% - 20px, 1160px);
    }

    .hero {
        padding-top: 42px;
    }

    .field-grid,
    .lunar-fields,
    .analysis-panel,
    .analysis-more-grid,
    .favorite-grid,
    .check-grid,
    .query-box {
        grid-template-columns: 1fr;
    }

    .name-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-save-guide {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .favorite-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .name-list {
        grid-template-columns: 1fr;
        max-height: 520px;
        min-height: 420px;
    }

    .quality-panel div {
        grid-template-columns: 1fr;
    }

    .homophone-panel div {
        grid-template-columns: 1fr;
    }

    .radar-panel svg {
        justify-self: center;
    }

    .ns-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .ns-grid-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .name-detail h3 {
        font-size: 34px;
    }

    .segmented {
        width: 100%;
    }

    .segmented button {
        flex: 1;
        min-width: 0;
    }
}
