/* ==========================================================
   EastWorld Base Styles
   Shared by all island pages
   ========================================================== */

/* --- CSS Variables --- */
:root {
    --bg-paper: #F9F7F1;
    --ink-black: #111111;
    --ink-blue: #0F172A;
    --accent-red: #D93025;
    --accent-gold: #B45309;
    --border-color: #111;
    --border-light: #E5E5E5;

    --font-serif: Georgia, "Nimbus Roman No9 L", "Songti SC", STSong, "Noto Serif CJK SC", "AR PL New Sung", "AR PL SungtiL GB", "WenQuanYi Bitmap Song", "AR PL UMing CN", NSimSun, SimSun, "TW-Sung", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: monospace;

    --spacing-unit: 24px;
}

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 1280px) and (min-height: 600px) {
    html {
        font-size: 18px;
    }
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-paper);
    color: var(--ink-black);
    margin: 0;
    padding: 0;
    line-height: 1;
    letter-spacing: 1px;
    font-size: 1rem;
    font-display: swap;
    /* 纸张噪点纹理 */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

p {
    text-wrap: pretty;
    overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
    overflow-wrap: break-word;
    font-weight: 700;
}

strong,
b {
    font-weight: 700;
}

cite::before {
    content: '\2014 \0020';
}

pre,
code {
    font-family: monospace, monospace;
}

section {
    line-height: 1.8;
}

a {
    color: inherit;
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: var(--accent-red);
}

/* --- Layout Utilities --- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.border-b {
    border-bottom: 2px solid var(--ink-black);
}

.border-t {
    border-top: 2px solid var(--ink-black);
}

.border-box {
    border: 2px solid var(--ink-black);
}

/* --- Form Elements --- */
input,
textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0 20px;
    border: 1px solid #ccc;
    background: #fafafa;
    font-family: var(--font-sans);
    font-size: 1rem;
}

input:focus,
textarea:focus {
    outline: 2px solid var(--ink-black);
    border-color: transparent;
}

label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 6px;
    color: #333;
}

/* --- Buttons --- */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--ink-black);
    color: #fff;
    border: none;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.1s;
}

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

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    display: inline-block;
    border: 1px solid #fff;
    color: #fff;
    padding: 10px 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
    background: transparent;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #fff;
    color: #000;
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--ink-black);
    color: #fff;
    padding: 12px 24px;
    font-family: var(--font-mono);
    opacity: 0;
    transform: translateY(20px);
    transition: 0.3s;
    z-index: 10000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- Modal Base --- */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #fff;
    margin: 5% auto;
    width: 90%;
    max-width: 480px;
    border: 2px solid var(--ink-black);
    box-shadow: 15px 15px 0 var(--ink-black);
    padding: 40px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--ink-black);
    padding-bottom: 12px;
}

.modal-header h2 {
    margin: 0;
    font-family: var(--font-serif);
}

.modal-close {
    cursor: pointer;
    font-size: 1.5rem;
}

.modal-close:hover {
    color: var(--accent-red);
}
