:root {
            --bg-color: #f5f5f5;
            --primary-color: #111;
            --accent-color: #000;
            --success-color: #27ae60;
            --error-color: #e74c3c;
            --text-color: #333;
            --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
            --border-radius: 12px;
        }

        /* 表单控件 */
        label {
            display: block;
            margin: 15px 0 8px;
            font-weight: 600;
            color: var(--primary-color);
        }

        textarea, input[type="number"], select {
            width: 100%;
            padding: 14px;
            border: 2px solid #e1e4e8;
            border-radius: 8px;
            font-size: 16px;
            box-sizing: border-box;
            font-family: inherit;
            transition: all 0.3s;
        }

        textarea:focus, input:focus, select:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
        }

        /* 模式切换 Tabs */
        .mode-tabs {
            display: flex;
            gap: 10px;
            margin-bottom: 15px;
        }

        .mode-tab {
            flex: 1;
            padding: 12px;
            text-align: center;
            background: #f0f2f5;
            border-radius: 8px;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
            color: #7f8c8d;
        }

        .mode-tab.active {
            background: var(--accent-color);
            color: white;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }

        /* 按钮样式 */
        .btn {
            width: 100%;
            padding: 15px;
            background-color: var(--primary-color);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 20px;
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .btn:active {
            transform: scale(0.98);
        }

        .btn.secondary {
            background-color: #ecf0f1;
            color: var(--primary-color);
        }

        .btn-group {
            display: flex;
            gap: 10px;
        }

        /* 游戏区域 */
        #status-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #fff;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.05);
            position: sticky;
            top: 10px;
            z-index: 100;
        }

        .stat-item b {
            color: var(--accent-color);
            font-size: 1.2rem;
        }

        #writing-area {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            justify-content: center;
            padding: 10px 0;
        }

        .char-box {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 50px;
        }

        .char-sample {
            font-size: 20px;
            color: #95a5a6;
            margin-bottom: 5px;
            font-family: "KaiTi", "楷体", serif;
            user-select: none;
        }

        .char-input {
            width: 50px;
            height: 50px;
            text-align: center;
            font-size: 26px;
            border: 2px solid #dfe6e9;
            border-radius: 10px;
            background: #fff;
            font-family: "KaiTi", "楷体", serif;
            color: var(--text-color);
            transition: all 0.2s;
            -webkit-appearance: none; /* iOS 移除内阴影 */
        }

        .char-input:focus {
            border-color: var(--accent-color);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .char-input.correct {
            border-color: var(--success-color);
            background-color: #f0fff4;
            color: var(--success-color);
        }

        .char-input.error {
            animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
            border-color: var(--error-color);
            background-color: #fff5f5;
        }

        /* 结果展示与证书 */
        #certificate-area {
            background: linear-gradient(135deg, #fffbf5 0%, #fff9f0 50%, #fffef8 100%);
            padding: 40px 35px;
            border-radius: 8px;
            position: relative;
            box-shadow:
                0 0 0 1px rgba(212, 175, 125, 0.3),
                0 0 0 4px rgba(212, 175, 125, 0.15),
                0 0 0 8px rgba(212, 175, 125, 0.08),
                0 20px 60px rgba(139, 90, 43, 0.15);
            overflow: hidden;
        }

        /* 证书装饰角 */
        #certificate-area::before,
        #certificate-area::after {
            content: '';
            position: absolute;
            width: 80px;
            height: 80px;
            border: 3px double rgba(180, 140, 80, 0.4);
            pointer-events: none;
        }

        #certificate-area::before {
            top: 15px;
            left: 15px;
            border-right: none;
            border-bottom: none;
        }

        #certificate-area::after {
            bottom: 15px;
            right: 15px;
            border-left: none;
            border-top: none;
        }

        /* 证书顶部装饰线 */
        .cert-decoration {
            text-align: center;
            margin-bottom: 25px;
        }

        .cert-decoration::before {
            content: '✦';
            color: #c9a86c;
            font-size: 24px;
            text-shadow: 0 1px 2px rgba(180, 140, 80, 0.3);
        }

        .cert-title {
            text-align: center;
            font-size: 32px;
            font-weight: bold;
            margin-bottom: 8px;
            font-family: "KaiTi", "楷体", "STKaiti", serif;
            color: #8b5a2b;
            text-shadow: 1px 1px 0 rgba(255,255,255,0.8);
            letter-spacing: 8px;
        }

        .cert-subtitle {
            text-align: center;
            color: #b8860b;
            margin-bottom: 25px;
            font-size: 15px;
            letter-spacing: 2px;
        }

        .cert-congrats {
            text-align: center;
            padding: 15px 25px;
            background: linear-gradient(135deg, #f0fff4 0%, #e8f5e9 100%);
            border-radius: 30px;
            color: #2e7d32;
            margin-bottom: 25px;
            font-size: 16px;
            font-weight: 500;
            border: 1px solid rgba(46, 125, 50, 0.2);
            display: inline-block;
            width: fit-content;
            margin-left: 50%;
            transform: translateX(-50%);
        }

        .cert-stats {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 15px;
            margin-bottom: 25px;
        }

        .cert-stat-item {
            background: linear-gradient(135deg, #fff 0%, #faf8f5 100%);
            padding: 15px;
            border-radius: 12px;
            text-align: center;
            border: 1px solid rgba(212, 175, 125, 0.2);
            transition: transform 0.2s;
        }

        .cert-stat-item:hover {
            transform: translateY(-2px);
        }

        .cert-stat-label {
            font-size: 12px;
            color: #999;
            margin-bottom: 5px;
            letter-spacing: 1px;
        }

        .cert-stat-value {
            font-size: 22px;
            font-weight: bold;
            color: #8b5a2b;
            font-family: "Georgia", serif;
        }

        .cert-divider {
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(180, 140, 80, 0.4), transparent);
            margin: 20px 0;
            position: relative;
        }

        .cert-divider::before {
            content: '❧';
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            background: linear-gradient(135deg, #fffbf5 0%, #fff9f0 100%);
            padding: 0 15px;
            color: #c9a86c;
            font-size: 18px;
        }

        .cert-content-label {
            font-size: 14px;
            color: #8b5a2b;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cert-content-label::before {
            content: '📜';
            font-size: 16px;
        }

        #result-content {
            white-space: pre-wrap;
            background: linear-gradient(135deg, #fffdf8 0%, #fefcf5 100%);
            padding: 20px;
            border-radius: 8px;
            font-family: "KaiTi", "楷体", "STKaiti", serif;
            font-size: 17px;
            line-height: 1.8;
            color: #5d4e37;
            border: 1px solid rgba(212, 175, 125, 0.25);
            position: relative;
        }

        #result-content::before {
            content: '"';
            position: absolute;
            top: 5px;
            left: 10px;
            font-size: 40px;
            color: rgba(180, 140, 80, 0.2);
            font-family: Georgia, serif;
            line-height: 1;
        }

        .cert-footer {
            margin-top: 30px;
            text-align: center;
            position: relative;
        }

        .cert-footer-text {
            font-size: 14px;
            color: #999;
            letter-spacing: 2px;
        }

        .cert-footer-date {
            font-size: 12px;
            color: #bbb;
            margin-top: 5px;
        }

        /* Toast 提示 */
        #toast-container {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }

        .toast {
            background: rgba(44, 62, 80, 0.9);
            color: #fff;
            padding: 12px 24px;
            border-radius: 50px;
            font-size: 14px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            opacity: 0;
            transform: translateY(-20px);
            transition: all 0.3s ease;
            text-align: center;
        }

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

        /* 动画 */
        @keyframes shake {
            10%, 90% { transform: translate3d(-1px, 0, 0); }
            20%, 80% { transform: translate3d(2px, 0, 0); }
            30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
            40%, 60% { transform: translate3d(4px, 0, 0); }
        }

        /* 屏幕闪烁效果 */
        .screen-flash {
            animation: flash-bg 0.3s;
        }
        @keyframes flash-bg {
            0%, 100% { background-color: var(--bg-color); }
            50% { background-color: rgba(231, 76, 60, 0.1); }
        }

        .hidden { display: none !important; }

        /* 移动端适配 */
        @media (max-width: 600px) {
            .char-box { width: 42px; }
            .char-input { width: 42px; height: 42px; font-size: 22px; }
            .container-grid { padding: 15px; }
            #writing-area { gap: 8px; }
            .page-title { font-size: 1.4rem; }
        }
