@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@400;600;700&display=swap');

/* 全局变量 */
:root {
    --bg-color: #0d0d0b;
    --card-bg: rgba(14, 13, 11, 0.88);
    --card-bg-strong: rgba(22, 18, 14, 0.94);
    --text-primary: #caa05a;
    --text-secondary: #b88f4e;
    --text-label: #b8b0a0;
    --text-body: #d6d6d2;
    --text-muted: #8a8a8a;
    
    /* 角色面板规范色 */
    --accent-red: #e24c4b;
    --accent-gold: #b8893f;
    --accent-gold-dark: #5f421c;
    --accent-gold-light: #d6ad62;
    --accent-purple: #b77bff;
    --accent-blue: #b77bff;
    --accent-green: #4caf7c;
    --accent-warning: #ffb347;
    --leather-brown: #3a2a1e;
    
    --border-color: rgba(184, 137, 63, 0.34);
    --border-muted: rgba(184, 176, 160, 0.16);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(240, 215, 156, 0.05);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(240, 215, 156, 0.06);
    
    --font-title: 'Cinzel', 'Noto Serif SC', 'Source Han Serif SC', '思源宋体 SC', serif;
    --font-serif: 'Noto Serif SC', 'Source Han Serif SC', '思源宋体 SC', serif;
    --font-sans: 'Noto Sans SC', 'Source Han Sans SC', '思源黑体 SC', system-ui, sans-serif;
    --font-mono: 'Cinzel', 'Noto Sans SC', monospace;
    --metal-text-shadow: 0 1px 0 rgba(255, 224, 145, 0.28), 0 2px 3px rgba(0,0,0,0.82), 0 0 5px rgba(184,137,63,0.18);
    --active-ornament: url("UI/sucai/711f2c3a-f120-4ef6-be4c-c662bf4ddd86.png");
    --stepper-arrow-up: url("UI/sucai/spinner-arrow-up-cutout.png");
    --stepper-arrow-down: url("UI/sucai/spinner-arrow-down-cutout.png");
    --header-fill: url("UI/rognqi/slices/header-fill.png");
    --entry-bg: url("UI/ChatGPT Image 2026年5月8日 03_56_42.png");
    --divider-left: url("/assets/ui/dividers/divider-left.png");
    --divider-center: url("/assets/ui/dividers/divider-center.png");
    --divider-right: url("/assets/ui/dividers/divider-right.png");
    --stat-card-bg: url("UI/pige/1777740498439.png");
    --hp-card-bg: url("UI/pige/sliced/hp-card-frame.png");
    --lay-on-hands-card-bg: url("UI/pige/sliced/lay-on-hands-card-frame.png");
    --divine-sense-card-bg: url("UI/pige/sliced/divine-sense-card-frame.png");
    --wallet-card-bg: url("UI/pige/sliced/wallet-frame.png");
    --card-frame-slice: 40 fill;
    --card-frame-width: 12px;
    --stat-panel-frame-slice: 132 fill;
    --stat-panel-frame-width: 12px;
    --portrait-frame: url("UI/portrait-frame-cutout.png");
    --header-slice-x: 6.875rem;
    --header-slice-y: 5.5rem;
}

/* 基础重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    background-image: url("UI/bei/29fe876b-099c-4588-9307-8bd340bc5f58.png");
    background-attachment: fixed;
    background-position: center bottom;
    background-size: cover;
    background-repeat: no-repeat;
    color: var(--text-body);
    line-height: 1.5;
    letter-spacing: 0.02em;
    padding-bottom: 4rem;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

body.entry-active {
    min-height: 100vh;
    padding-bottom: 0;
    background-image: none;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

input, textarea {
    font-family: inherit;
    border: none;
    background: transparent;
    outline: none;
    color: inherit;
}

/* 登录与角色库 */
.entry-screen {
    min-height: 100dvh;
    padding: 2rem;
    display: grid;
    place-items: center;
    background:
        linear-gradient(90deg, rgba(5, 5, 4, 0.82), rgba(5, 5, 4, 0.56) 48%, rgba(5, 5, 4, 0.8)),
        radial-gradient(circle at 50% 18%, rgba(202, 160, 90, 0.16), transparent 26rem),
        var(--entry-bg),
        rgba(5, 5, 4, 0.42);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.entry-panel,
.library-shell {
    width: min(100%, 28rem);
    background: rgba(12, 11, 9, 0.91);
    border: 1px solid rgba(214, 173, 98, 0.32);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 231, 172, 0.08);
    backdrop-filter: blur(12px);
}

.entry-panel {
    padding: 2rem;
}

.library-shell {
    width: min(100%, 58rem);
    padding: 2rem;
}

.entry-kicker {
    font-family: var(--font-title);
    font-size: 0.74rem;
    color: var(--accent-gold-light);
    letter-spacing: 0.12em;
    margin-bottom: 0.35rem;
}

.entry-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 7vw, 3.35rem);
    line-height: 1.1;
    color: var(--text-primary);
    text-shadow: var(--metal-text-shadow);
    letter-spacing: 0;
}

.login-panel .entry-kicker,
.login-panel .entry-title {
    text-align: center;
}

.login-panel .entry-kicker {
    font-size: 0.68rem;
    line-height: 1;
    letter-spacing: 0.18em;
    margin-bottom: 0.65rem;
    color: rgba(214, 173, 98, 0.76);
}

.login-panel .entry-title {
    white-space: nowrap;
    font-size: clamp(1.72rem, 3.15vw, 2.55rem);
    line-height: 1.08;
    max-width: 100%;
    overflow: visible;
    color: #d8b56f;
    text-shadow: 0 1px 0 rgba(255, 230, 166, 0.24), 0 2px 5px rgba(0, 0, 0, 0.86);
}

.login-panel .login-form:first-of-type {
    margin-top: 1.55rem;
}

.trial-btn {
    width: 100%;
    margin-top: 0.85rem;
    justify-content: center;
    min-height: 3rem;
}

.login-form {
    margin-top: 1.75rem;
    display: grid;
    gap: 1rem;
}

.entry-field {
    display: grid;
    gap: 0.45rem;
    color: var(--text-label);
    font-size: 0.86rem;
    font-weight: 700;
}

.entry-field input {
    min-height: 3rem;
    padding: 0 0.95rem;
    color: var(--text-body);
    background: rgba(214, 214, 210, 0.06);
    border: 1px solid var(--border-muted);
    border-radius: 0.375rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.entry-field input:focus {
    border-color: var(--accent-gold-light);
    background: rgba(214, 214, 210, 0.09);
    box-shadow: 0 0 0 3px rgba(214, 173, 98, 0.14);
}

.entry-error {
    min-height: 1.25rem;
    color: var(--accent-red);
    font-size: 0.84rem;
}

.entry-primary-btn,
.entry-secondary-btn,
.entry-text-btn,
.new-character-btn,
.character-select-card,
.character-open-area,
.character-delete-btn,
.library-return-btn {
    cursor: pointer;
    transition: transform 0.18s, border-color 0.18s, background 0.18s, color 0.18s;
}

.entry-primary-btn {
    min-height: 3rem;
    border: 1px solid rgba(214, 173, 98, 0.62);
    border-radius: 0.375rem;
    background: linear-gradient(180deg, rgba(202, 160, 90, 0.26), rgba(95, 66, 28, 0.72));
    color: #f4dfb2;
    font-weight: 800;
    font-family: var(--font-serif);
}

.entry-primary-btn:hover,
.new-character-btn:hover,
.character-select-card:hover {
    transform: translateY(-1px);
    border-color: var(--accent-gold-light);
}

.entry-text-btn {
    margin-top: 0.85rem;
    border: 0;
    background: transparent;
    color: rgba(214, 173, 98, 0.78);
    font-size: 0.84rem;
    font-weight: 700;
}

.entry-text-btn:hover {
    color: var(--accent-gold-light);
}

.register-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-muted);
}

.library-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.library-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.entry-secondary-btn {
    min-height: 2.35rem;
    padding: 0 0.85rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    background: rgba(214, 214, 210, 0.05);
    color: var(--text-label);
    font-weight: 700;
}

.entry-secondary-btn:hover {
    color: var(--accent-gold-light);
    border-color: var(--accent-gold-light);
}

.character-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}

.character-select-card,
.new-character-btn {
    min-height: 7.5rem;
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background: rgba(214, 214, 210, 0.055);
    color: var(--text-body);
    text-align: left;
}

.character-select-card {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.75rem;
    padding-right: 1rem;
}

.character-open-area {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    display: grid;
    align-content: center;
    gap: 0.4rem;
    text-align: left;
}

.character-card-name {
    font-family: var(--font-serif);
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0;
}

.character-card-meta {
    color: var(--text-label);
    font-size: 0.86rem;
}

.character-card-owner,
.empty-state {
    color: rgba(214, 214, 210, 0.62);
    font-size: 0.78rem;
}

.character-delete-btn {
    align-self: center;
    margin-left: auto;
    flex: 0 0 auto;
    min-height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(226, 76, 75, 0.42);
    background: rgba(226, 76, 75, 0.08);
    color: #f0a09b;
    font-weight: 800;
}

.character-delete-btn:hover {
    border-color: var(--accent-red);
    background: rgba(226, 76, 75, 0.16);
    color: #ffd2cf;
}

.app-footer {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-muted);
    color: rgba(184, 176, 160, 0.78);
    font-family: var(--font-title);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-align: center;
}

.entry-footer {
    margin-top: 1.5rem;
}

.admin-entry-link {
    display: inline-flex;
    margin-top: 0.85rem;
    color: rgba(214, 173, 98, 0.78);
    font-size: 0.84rem;
    text-decoration: none;
}

.admin-entry-link:hover {
    color: var(--accent-gold-light);
}

.sheet-footer {
    max-width: 1200px;
    margin: 1.5rem auto 0;
    padding-left: 1rem;
    padding-right: 1rem;
}

.new-character-btn {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    color: var(--accent-gold-light);
    font-weight: 800;
}

.new-character-plus {
    width: 1.8rem;
    height: 1.8rem;
    display: inline-grid;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 1.35rem;
    line-height: 1;
}

.library-return-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 独立账号后台 */
.admin-shell {
    width: min(100%, 68rem);
    padding: 2rem;
    background: rgba(12, 11, 9, 0.93);
    border: 1px solid rgba(214, 173, 98, 0.32);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 231, 172, 0.08);
    backdrop-filter: blur(12px);
}

.admin-actions,
.admin-form-actions,
.account-card-actions,
.invite-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.admin-link-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.admin-account-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-muted);
    background: rgba(214, 214, 210, 0.045);
    border-radius: 0.375rem;
}

.admin-check {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-label);
    font-weight: 700;
    cursor: pointer;
}

.admin-check input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent-gold);
}

.admin-form-actions {
    grid-column: 1 / -1;
}

.account-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.invite-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-muted);
}

.invite-header {
    justify-content: space-between;
    margin-bottom: 1rem;
}

.admin-section-title {
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-size: 1.35rem;
    letter-spacing: 0;
}

.invite-create-btn {
    min-height: 2.5rem;
    padding: 0 1rem;
}

.invite-list {
    display: grid;
    gap: 0.85rem;
}

.invite-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: rgba(214, 214, 210, 0.055);
}

.invite-card h3 {
    color: var(--accent-gold-light);
    font-family: var(--font-title);
    font-size: 1.05rem;
    letter-spacing: 0.06em;
}

.invite-card p {
    color: var(--text-label);
    font-size: 0.86rem;
}

.invite-card.used {
    opacity: 0.68;
}

.account-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: rgba(214, 214, 210, 0.055);
}

.account-card h2 {
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-size: 1.15rem;
    letter-spacing: 0;
}

.account-card p {
    color: var(--text-label);
    font-size: 0.86rem;
}

.character-delete-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

input::placeholder,
textarea::placeholder {
    color: rgba(138, 138, 138, 0.72);
}

.divider {
    width: 100%;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    gap: 0;
    height: 8px;
    align-items: center;
    pointer-events: none;
}

.divider-left,
.divider-right {
    width: 24px;
    height: 8px;
    min-width: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.divider-left {
    background-image: var(--divider-left);
}

.divider-center {
    height: 3px;
    min-width: 0;
    opacity: 0.65;
    transform: translateY(-1.5px);
    background-image: var(--divider-center);
    background-repeat: repeat-x;
    background-position: center;
    background-size: auto 3px;
}

.divider-right {
    background-image: var(--divider-right);
}

.name-divider {
    position: absolute;
    left: 0;
    right: auto;
    width: calc((120% - 16.8rem) * 0.96);
    transform: none;
    bottom: -0.45rem;
}

.wallet-divider {
    margin: -0.45rem 0 0.75rem;
}

.section-divider {
    margin: -0.55rem 0 1rem;
}

.card-divider {
    margin: -0.05rem 0 0.65rem;
}

/* 顶部导航 */
.top-nav {
    background: rgba(11, 10, 9, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4rem;
}

.nav-tabs {
    display: flex;
    gap: 2rem;
}

.nav-btn {
    background: none;
    border: none;
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-label);
    cursor: pointer;
    padding: 1rem 0.5rem;
    border-bottom: 3px solid transparent;
    position: relative;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-btn.active {
    color: var(--accent-gold-light);
    border-bottom-color: transparent;
    text-shadow: var(--metal-text-shadow);
}

.nav-btn.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.48rem;
    width: 8.6rem;
    height: 1.45rem;
    transform: translateX(-50%);
    pointer-events: none;
    background-image: var(--active-ornament);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 11.5rem auto;
    mix-blend-mode: screen;
    opacity: 0.95;
}

.nav-btn:last-child.active {
    color: var(--accent-blue);
    border-bottom-color: transparent;
}

.icon-btn {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--text-secondary);
    width: 2.375rem;
    height: 2.375rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(212,175,106,0.1);
    color: var(--accent-gold-light);
    border-color: var(--border-color);
}

/* 头部样式 */
.char-header {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.trial-cache-warning {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(255, 179, 71, 0.45);
    border-radius: 0.375rem;
    background: rgba(255, 179, 71, 0.12);
    color: var(--accent-warning);
    font-weight: 800;
    text-align: center;
}

.header-content {
    position: relative;
    min-height: 285px;
    box-shadow: var(--shadow-md);
    overflow: visible;
}

.container-bg {
    position: absolute;
    inset: var(--header-slice-y) var(--header-slice-x);
    background-image: var(--header-fill);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 0;
}

.container-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.container-content {
    position: relative;
    z-index: 2;
    padding: 2.2rem 3rem 2.2rem;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    align-items: center;
    column-gap: 2.4rem;
    min-height: 285px;
}

.frame-edge,
.frame-corner {
    position: absolute;
    background-repeat: no-repeat;
}

.frame-edge-top,
.frame-edge-bottom {
    left: var(--header-slice-x);
    right: var(--header-slice-x);
    height: var(--header-slice-y);
    background-repeat: repeat-x;
    background-size: auto 100%;
}

.frame-edge-top {
    top: 0;
    background-image: url("UI/rognqi/slices/edge-top.png");
    background-position: center top;
}

.frame-edge-bottom {
    bottom: 0;
    background-image: url("UI/rognqi/slices/edge-bottom.png");
    background-position: center bottom;
}

.frame-edge-left,
.frame-edge-right {
    top: var(--header-slice-y);
    bottom: var(--header-slice-y);
    width: var(--header-slice-x);
    background-repeat: repeat-y;
    background-size: 100% auto;
}

.frame-edge-left {
    left: 0;
    background-image: url("UI/rognqi/slices/edge-left.png");
    background-position: left center;
}

.frame-edge-right {
    right: 0;
    background-image: url("UI/rognqi/slices/edge-right.png");
    background-position: right center;
}

.frame-corner {
    width: var(--header-slice-x);
    height: var(--header-slice-y);
    background-size: 100% 100%;
}

.frame-corner-tl {
    top: 0;
    left: 0;
    background-image: url("UI/rognqi/slices/corner-tl.png");
    background-position: left top;
}

.frame-corner-tr {
    top: 0;
    right: 0;
    background-image: url("UI/rognqi/slices/corner-tr.png");
    background-position: right top;
}

.frame-corner-br {
    right: 0;
    bottom: 0;
    background-image: url("UI/rognqi/slices/corner-br.png");
    background-position: right bottom;
}

.frame-corner-bl {
    left: 0;
    bottom: 0;
    background-image: url("UI/rognqi/slices/corner-bl.png");
    background-position: left bottom;
}

.portrait-container {
    width: 170px;
    height: 170px;
    position: relative;
    flex-shrink: 0;
    border-radius: 50%;
}

.portrait-mask {
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    overflow: hidden;
    background: #0b0a08;
    z-index: 1;
    cursor: grab;
    touch-action: none;
}

.portrait-mask:active {
    cursor: grabbing;
}

.portrait-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transform-origin: center;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.portrait-border {
    position: absolute;
    inset: -4px;
    z-index: 2;
    background-image: var(--portrait-frame);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    pointer-events: none;
}

.portrait-controls {
    position: absolute;
    right: 0.65rem;
    bottom: 0.55rem;
    z-index: 3;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.portrait-controls button {
    width: 1.45rem;
    height: 1.45rem;
    border: 1px solid rgba(214, 173, 98, 0.62);
    border-radius: 999px;
    background: rgba(12, 10, 8, 0.84);
    color: var(--accent-gold-light);
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.portrait-upload-btn {
    position: absolute;
    left: 50%;
    bottom: 0.55rem;
    transform: translateX(-50%);
    z-index: 3;
    border: 1px solid rgba(214, 173, 98, 0.62);
    border-radius: 0.35rem;
    background: rgba(12, 10, 8, 0.84);
    color: var(--accent-gold-light);
    padding: 0.22rem 0.55rem;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.portrait-container:hover .portrait-upload-btn,
.portrait-container:hover .portrait-controls,
.portrait-controls:focus-within,
.portrait-upload-btn:focus {
    opacity: 1;
}

.portrait-upload-btn:hover {
    background: rgba(30, 22, 14, 0.95);
}

.char-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
    padding-right: 5rem;
    transform: translateY(-0.75rem);
}

.name-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-top: 1.75rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.8rem;
    position: relative;
}


.char-name-input {
    font-family: var(--font-serif);
    font-size: 2.25rem;
    font-weight: 700;
    width: 100%;
    color: var(--accent-gold-light);
    letter-spacing: 0.02em;
    text-shadow: var(--metal-text-shadow);
}

.level-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: url("UI/sucai/1777729914453.png") center / contain no-repeat;
    color: var(--accent-gold-light);
    width: 10.839rem;
    height: 10.839rem;
    padding: 2.335rem 2.335rem 2.806rem;
    white-space: nowrap;
    position: absolute;
    right: -3.9rem;
    top: 93%;
    transform: translateY(-50%);
    z-index: 1;
}

.level-label {
    font-size: 0.897rem;
    font-weight: 700;
    color: rgba(240,215,156,0.8);
    line-height: 1.05;
    letter-spacing: 0.08em;
    text-shadow: 0 1px 2px rgba(0,0,0,0.85);
}

.level-input {
    font-family: var(--font-title);
    font-size: 2.818rem;
    font-weight: 700;
    width: 3.738rem;
    text-align: center;
    color: var(--accent-gold-light);
    text-shadow: var(--metal-text-shadow);
    line-height: 0.95;
}

.tags-row {
    display: flex;
    justify-content: flex-start;
    gap: 1.35rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-input {
    width: auto;
    min-width: 0;
    max-width: 5.5rem;
    border-bottom: 1px dotted var(--text-muted);
    transition: border-color 0.2s;
}

.tag-input:focus {
    border-bottom: 1px solid var(--accent-gold);
}

.separator {
    color: var(--accent-gold);
    font-weight: bold;
    margin: 0 0.1rem;
}

.physical-row {
    display: flex;
    gap: 1.85rem;
    padding-top: 0;
}

.phy-item {
    display: flex;
    flex-direction: column;
}

.phy-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-label);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.phy-input {
    font-weight: 600;
    color: var(--text-body);
    width: 4rem;
    font-family: var(--font-mono);
}

/* 主内容布局 */
#main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: stretch;
}

/* 属性盒子 */
.stats-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.details-column {
    display: flex;
    flex-direction: column;
}

.stat-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
    color: var(--text-body);
}

.stat-box.fantasy-card {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    min-height: 8.5rem;
    padding: 1.35rem 1.45rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stats-column > .stat-box.fantasy-card:first-child {
    min-height: 5rem;
}

.stat-box.fantasy-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border: var(--stat-panel-frame-width) solid transparent;
    border-image-source: var(--stat-card-bg);
    border-image-slice: var(--stat-panel-frame-slice);
    border-image-width: var(--stat-panel-frame-width);
    border-image-repeat: stretch;
    pointer-events: none;
    z-index: 0;
}

.stat-box.fantasy-card > * {
    position: relative;
    z-index: 1;
}

.stat-box:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.stat-box.fantasy-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 4.5rem;
    border-right: 1px solid var(--border-color);
    padding-right: 0.75rem;
    justify-content: center;
}

.stat-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-score {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    color: var(--text-primary);
    text-shadow: var(--metal-text-shadow);
}

.stat-score-control,
.inline-number-row {
    display: flex;
    align-items: center;
}

.stat-score-control {
    justify-content: center;
    width: 100%;
}

.number-stepper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.05rem;
    width: 1rem;
    margin-left: 0.08rem;
}

.number-step {
    width: 0.9rem;
    height: 0.65rem;
    border: 0;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    cursor: pointer;
    opacity: 0.92;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.7));
    transition: opacity 0.15s, transform 0.15s;
}

.number-step:hover {
    opacity: 1;
    transform: scale(1.08);
}

.number-step.up {
    background-image: var(--stepper-arrow-up);
}

.number-step.down {
    background-image: var(--stepper-arrow-down);
}

.stat-score::-webkit-outer-spin-button,
.stat-score::-webkit-inner-spin-button,
.inline-number::-webkit-outer-spin-button,
.inline-number::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.stat-score,
.inline-number {
    appearance: textfield;
    -moz-appearance: textfield;
}

.stat-mod {
    background: linear-gradient(180deg, #c2964c, #6b4a20);
    color: #201507;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.125rem 0.75rem;
    border-radius: 999px;
    margin-top: 0.25rem;
    box-shadow: inset 0 1px 0 rgba(255, 223, 143, 0.22), 0 2px 5px rgba(0,0,0,0.34);
}

.stat-skills {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.inline-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.inline-plus,
.inline-number {
    color: var(--accent-red);
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    text-shadow: var(--metal-text-shadow);
}

.inline-number {
    width: 2rem;
}

.skill-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.125rem 0;
}

.skill-row:hover .skill-name {
    color: var(--accent-gold-light);
}

.skill-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    border: 1px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(214, 214, 210, 0.08);
}

.skill-dot.active {
    background: var(--accent-red);
    border-color: var(--accent-red);
}

.skill-dot-inner {
    width: 0.25rem;
    height: 0.25rem;
    background: #17110a;
    border-radius: 50%;
}

.skill-name {
    font-size: 0.8125rem;
    color: var(--text-label);
    flex: 1;
}

.skill-name.active {
    font-weight: 600;
    color: var(--accent-red);
}

.skill-val {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-label);
}

.skill-val.active {
    font-weight: 700;
    color: var(--accent-red);
}

/* 钱包 */
.wallet-box {
    background: transparent var(--wallet-card-bg) center / 100% 100% no-repeat;
    border: 1px solid transparent;
    border-radius: 0;
    padding: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.wallet-header {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-gold-light);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}


.coin-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
}

.coin-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.coin-icon {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    image-rendering: auto;
}

.coin-input {
    width: 100%;
    min-width: 0;
    height: 1.25rem;
    text-align: center;
    font-family: var(--font-serif);
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.coin-input:focus {
    border-bottom-color: var(--accent-gold);
}

.proficiencies-box {
    background: rgba(14, 13, 11, 0.88);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: 0.75rem;
}

.proficiencies-header {
    text-align: center;
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-gold-light);
    letter-spacing: 0.04em;
}

.proficiency-field {
    display: grid;
    gap: 0.35rem;
}

.proficiency-field span {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.proficiency-field input,
.proficiency-field textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border-muted);
    border-radius: 0.25rem;
    background: rgba(214, 214, 210, 0.05);
    color: var(--text-body);
    line-height: 1.5;
}

.proficiency-field input {
    min-height: 2.25rem;
}

.proficiency-field textarea {
    min-height: 4.25rem;
    resize: vertical;
}

.proficiency-field input[readonly],
.proficiency-field textarea[readonly] {
    cursor: default;
}

/* 战斗数值网格 */
.combat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.combat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.large-card {
    width: 100%;
    height: 120px;
}

.hp-card,
.lay-on-hands-card,
.divine-sense-card {
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    overflow: hidden;
}

.stat-card {
    background-color: transparent;
    background-image: var(--stat-card-bg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    border-color: transparent;
    border: 1px solid transparent;
    border-radius: 0;
}

.hp-card .card-bg,
.lay-on-hands-card .card-bg,
.divine-sense-card .card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    box-sizing: border-box;
    border: var(--card-frame-width) solid transparent;
    border-image-slice: var(--card-frame-slice);
    border-image-width: var(--card-frame-width);
    border-image-repeat: stretch;
    pointer-events: none;
}

.hp-card .card-content,
.lay-on-hands-card .card-content,
.divine-sense-card .card-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.combat-card.large {
    grid-column: span 2;
    border: 2px solid var(--accent-red);
    background: linear-gradient(135deg, #4a1512, #18110f);
}

.combat-card.hp-card {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 0;
    overflow: hidden;
}

.hp-card .card-bg {
    border-image-source: var(--hp-card-bg);
}

.combat-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-label);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.combat-label-input {
    width: 100%;
    text-align: center;
}

.combat-value {
    font-family: var(--font-serif);
    font-size: clamp(1.15rem, 2.2vw, 2rem);
    font-weight: 700;
    width: 100%;
    text-align: center;
    color: var(--text-primary);
    text-shadow: var(--metal-text-shadow);
}

.hp-container {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-around;
}

.hp-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hp-inputs {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.hp-current {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-red);
    width: 3.5rem;
    text-align: center;
    text-shadow: 0 0 8px rgba(226,76,75,0.28), 0 2px 2px rgba(0,0,0,0.72);
}

.hp-separator {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.hp-max {
    font-size: 1.25rem;
    color: var(--text-secondary);
    width: 2.5rem;
    text-align: center;
    font-family: var(--font-mono);
    border-bottom: 1px solid rgba(168, 162, 158, 0.35);
}

.hp-temp {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-purple);
    width: 3.5rem;
    text-align: center;
}

.hit-dice-total {
    color: var(--text-muted);
    width: 2rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(168, 162, 158, 0.35);
}

/* 圣武士资源池 */
.paladin-resources {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.resource-card {
    background: #12100e;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.resource-card.lay-on-hands {
    border: 1px solid var(--accent-gold);
    background: linear-gradient(135deg, #3a2a1e, #0e0d0b);
}

.resource-card.divine-sense {
    border: 1px solid var(--accent-purple);
    background: linear-gradient(135deg, #2e1a47, #0e0d0b);
}

.resource-card.lay-on-hands-card,
.resource-card.divine-sense-card {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

.lay-on-hands-card .card-bg {
    border-image-source: var(--lay-on-hands-card-bg);
}

.divine-sense-card .card-bg {
    border-image-source: var(--divine-sense-card-bg);
}

.resource-header {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: center;
}

.resource-card.lay-on-hands .resource-header { color: var(--accent-gold-light); }
.resource-card.divine-sense .resource-header { color: var(--accent-purple); }

.resource-title {
    flex: 1;
    min-width: 0;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    text-align: center;
}

.resource-title:focus {
    border-bottom: 1px solid currentColor;
}

.resource-inputs {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.res-curr {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    width: 3rem;
    text-align: right;
    border-bottom: 2px solid transparent;
}

.resource-card.lay-on-hands .res-curr { color: var(--accent-gold-light); border-color: rgba(240, 215, 156, 0.28); text-shadow: var(--metal-text-shadow); }
.resource-card.divine-sense .res-curr { color: var(--accent-purple); border-color: rgba(183, 123, 255, 0.28); }

.res-max {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--text-muted);
    width: 2.5rem;
}

/* 武器列表 */
.weapons-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-family: var(--font-title);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    letter-spacing: 0.04em;
    text-shadow: var(--metal-text-shadow);
}


.weapon-header {
    display: grid;
    grid-template-columns: 5fr 3fr 4fr;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--text-label);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.weapon-row {
    display: grid;
    grid-template-columns: 5fr 3fr 4fr;
    align-items: center;
    background: rgba(214,214,210,0.06);
    padding: 0.75rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.weapon-row:hover {
    background: rgba(212,175,106,0.08);
    border-color: var(--accent-gold);
}

.weapon-name {
    font-weight: 600;
    color: var(--text-primary);
    width: 100%;
}

.weapon-atk {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--accent-red);
    text-align: center;
    width: 100%;
    font-size: 1.125rem;
}

.weapon-dmg {
    font-size: 0.875rem;
    color: var(--text-body);
    width: 100%;
    font-family: var(--font-mono);
}

/* 底部标签页 */
.bottom-tabs {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    flex: 1;
    box-shadow: var(--shadow-sm);
}

.tab-headers {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: rgba(214,214,210,0.06);
}

.tab-header-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-label);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    position: relative;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tab-header-btn:hover {
    background: rgba(212,175,106,0.08);
    color: var(--text-primary);
}

.tab-header-btn.active {
    background: var(--card-bg);
    color: var(--accent-gold-light);
    border-bottom-color: transparent;
}

.tab-header-btn.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.62rem;
    width: min(13rem, 92%);
    height: 1.75rem;
    transform: translateX(-50%);
    pointer-events: none;
    background-image: var(--active-ornament);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16rem auto;
    mix-blend-mode: screen;
    opacity: 0.95;
}

.tab-content {
    padding: 1.5rem;
    flex: 1;
    min-height: 0;
    display: flex;
}

.textarea-full {
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1;
    resize: none;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-body);
    background: transparent;
    font-family: var(--font-serif);
    display: block;
}

/* 法术书样式 */
.spells-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.spell-stat-card {
    position: relative;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    min-height: 8rem;
    padding: 1.35rem 1.45rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.spell-stat-card::before {
    content: "";
    position: absolute;
    inset: var(--card-frame-width);
    background: linear-gradient(135deg, rgba(14, 13, 11, 0.94), rgba(8, 8, 7, 0.96));
    pointer-events: none;
    z-index: 0;
}

.spell-stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border: var(--card-frame-width) solid transparent;
    border-image-source: var(--stat-card-bg);
    border-image-slice: var(--card-frame-slice);
    border-image-width: var(--card-frame-width);
    border-image-repeat: stretch;
    pointer-events: none;
    z-index: 1;
}

.spell-stat-card > * {
    position: relative;
    z-index: 2;
    transform: translateY(-0.45rem);
}


.spell-stat-card .combat-label {
    width: 100%;
    margin-bottom: 0.45rem;
}



.spell-select {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-purple);
    border: none;
    background: transparent;
    text-align: center;
    cursor: pointer;
    width: 100%;
}

.concentration-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 2px dashed var(--border-color);
    background: rgba(183,123,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.concentration-btn:hover {
    border-color: var(--accent-purple);
    background: rgba(183,123,255,0.14);
}

.concentration-btn.active {
    background: rgba(183,123,255,0.16);
    border-color: var(--accent-purple);
    border-style: solid;
    color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(183, 123, 255, 0.2);
}

.concentration-text {
    font-family: var(--font-title);
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.spell-slots-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.slot-box {
    background: rgba(214,214,210,0.06);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slot-level {
    width: 100%;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-label);
    text-transform: uppercase;
    margin-bottom: 0.45rem;
    text-align: center;
}


.slot-inputs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.slot-curr {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-purple);
    width: 2rem;
    text-align: center;
}

.slot-max {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    color: var(--text-muted);
    width: 1.5rem;
    text-align: center;
}

.spell-list-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.spell-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}


.add-spell-btn {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-label);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    background: rgba(214,214,210,0.06);
    cursor: pointer;
    transition: all 0.2s;
}

.add-spell-btn:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.spell-item {
    background: rgba(14,13,11,0.72);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.spell-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-purple);
}

.spell-top-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.45rem;
}


.prep-dot {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: rgba(214,214,210,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.prep-dot:hover {
    border-color: var(--accent-purple);
}

.prep-dot.active {
    border-color: var(--accent-purple);
    background: rgba(183,123,255,0.18);
}

.prep-inner {
    width: 0.625rem;
    height: 0.625rem;
    background: var(--accent-purple);
    border-radius: 50%;
}

.spell-name-input {
    flex: 1;
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--text-primary);
    font-family: var(--font-serif);
}

.spell-level-badge {
    display: flex;
    align-items: center;
    background: rgba(214,214,210,0.06);
    border: 1px solid var(--border-color);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-label);
}

.spell-level-input {
    width: 1.5rem;
    text-align: center;
    font-weight: 700;
    color: var(--accent-purple);
}

.conc-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
    background: rgba(214,214,210,0.06);
    color: var(--text-label);
    cursor: pointer;
}

.conc-badge.active {
    background: rgba(255,179,71,0.14);
    border-color: var(--accent-warning);
    color: var(--accent-warning);
}

.spell-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.spell-detail-box {
    background: rgba(214,214,210,0.05);
    border: 1px solid var(--border-muted);
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.detail-label {
    color: var(--text-label);
    font-weight: 700;
}

.detail-input {
    flex: 1;
    color: var(--text-body);
}

.spell-effect-box {
    background: rgba(214,214,210,0.05);
    border: 1px solid var(--border-muted);
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.spell-effect-input {
    width: 100%;
    min-height: 4.5rem;
    resize: vertical;
    line-height: 1.5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    :root {
        --header-slice-x: 2.75rem;
        --header-slice-y: 2.35rem;
    }

    body {
        padding-bottom: 2rem;
    }

    .entry-screen {
        padding: 1rem;
    }

    .entry-panel,
    .library-shell {
        padding: 1.25rem;
    }

    .library-header {
        flex-direction: column;
    }

    .admin-account-form {
        grid-template-columns: 1fr;
    }

    .account-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .invite-card,
    .invite-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .character-card-list {
        grid-template-columns: 1fr;
    }

    .character-select-card {
        flex-direction: column;
    }

    .character-delete-btn {
        align-self: flex-end;
    }

    .nav-container {
        height: auto;
        min-height: 4rem;
        flex-wrap: wrap;
        gap: 0.7rem;
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .nav-tabs {
        gap: 1rem;
    }

    .nav-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .char-header {
        margin: 1rem auto 1.25rem;
        padding: 0 0.75rem;
    }

    #main-content {
        padding: 0 0.75rem;
    }

    .grid-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .combat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .spells-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .header-content {
        min-height: auto;
        text-align: center;
    }

    .container-content {
        grid-template-columns: 1fr;
        justify-items: center;
        align-items: center;
        min-height: auto;
        padding: 2.25rem 1.25rem 2rem;
        row-gap: 1rem;
    }

    .portrait-container {
        width: 132px;
        height: 132px;
    }

    .portrait-mask {
        inset: 14px;
    }

    .portrait-upload-btn,
    .portrait-controls {
        opacity: 1;
    }

    .char-info {
        width: 100%;
        transform: none;
    }
    
    .name-row {
        flex-direction: column;
        align-items: center;
        gap: 0.45rem;
        margin-top: 0;
        margin-bottom: 0.65rem;
        padding-bottom: 0.6rem;
    }
    
    .char-name-input {
        width: min(100%, 18rem);
        font-size: clamp(1.55rem, 8vw, 2rem);
        text-align: center;
    }

    .name-divider {
        left: 50%;
        width: 96%;
        transform: translateX(-50%);
    }

    .char-info {
        padding-right: 0;
    }
    
    .physical-row {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.85rem 1.15rem;
    }
    
    .tags-row {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.45rem 0.85rem;
        margin-bottom: 0.8rem;
        font-size: 0.78rem;
    }

    .tag-input {
        max-width: min(7rem, 38vw);
        text-align: center;
    }

    .phy-input {
        width: 4.75rem;
        text-align: center;
    }

    .level-badge {
        position: static;
        justify-self: center;
        transform: none;
        width: 6.8rem;
        height: 6.8rem;
        padding: 1.45rem 1.45rem 1.75rem;
    }

    .level-label {
        font-size: 0.68rem;
    }

    .level-input {
        width: 2.75rem;
        font-size: 1.9rem;
    }

    .coin-grid {
        gap: 0.35rem;
    }

    .coin-icon {
        width: 1.65rem;
        height: 1.65rem;
    }

    .coin-input {
        font-size: 0.68rem;
    }
    
    .paladin-resources {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .entry-screen {
        padding: 0.75rem;
    }

    .top-nav {
        position: sticky;
        top: 0;
    }

    .nav-container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .nav-tabs {
        width: 100%;
        justify-content: center;
        gap: 0.75rem;
    }

    .nav-actions {
        width: 100%;
        justify-content: center;
    }

    .char-header,
    #main-content,
    .sheet-footer {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .container-content {
        padding: 2rem 0.85rem 1.8rem;
    }

    .tags-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .tags-row .separator {
        display: none;
    }

    .tag-input {
        width: 100%;
        max-width: none;
        justify-self: stretch;
    }

    .physical-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .phy-item {
        align-items: center;
    }

    .combat-grid,
    .spells-grid,
    .slots-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .wallet-box {
        padding: 0.85rem 0.65rem;
    }

    .coin-grid {
        grid-template-columns: repeat(5, minmax(2.65rem, 1fr));
        gap: 0.25rem;
    }
}

/* 锁定/只读模式样式 */
body.locked-mode input,
body.locked-mode select {
    pointer-events: none;
    border-bottom-color: transparent !important;
}

body.locked-mode textarea:not(.textarea-full) {
    pointer-events: none;
    border-bottom-color: transparent !important;
}

body.locked-mode .textarea-full {
    pointer-events: auto;
    cursor: default;
    user-select: text;
    border-bottom-color: transparent !important;
}

body.locked-mode .add-spell-btn {
    display: none;
}

body.locked-mode .prep-dot,
body.locked-mode .conc-badge,
body.locked-mode .concentration-btn,
body.locked-mode .skill-row,
body.locked-mode .weapon-row,
body.locked-mode .resource-inputs input,
body.locked-mode .hp-inputs input,
body.locked-mode .stat-score,
body.locked-mode .coin-input,
body.locked-mode .proficiency-field input,
body.locked-mode .proficiency-field textarea {
    pointer-events: none;
    cursor: default;
}

body.locked-mode .number-stepper {
    display: none;
}

/* 锁定模式下隐藏导入按钮，防止意外覆盖 */
body.locked-mode #import-btn-wrapper {
    display: none;
}

body.locked-mode .portrait-upload-btn {
    display: none;
}

body.locked-mode .portrait-controls {
    display: none;
}

body.locked-mode .portrait-mask {
    cursor: default;
}
