* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(160deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    min-height: 100vh;
    padding: 20px 16px 40px;
    color: #e0e0e0;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 30px 0 24px;
}

header h1 {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

header p {
    margin-top: 6px;
    font-size: 13px;
    color: #8892b0;
}

.card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ccd6f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-area {
    position: relative;
}

textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    color: #e0e0e0;
    font-size: 15px;
    resize: none;
    transition: all 0.25s ease;
    font-family: inherit;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(0, 0, 0, 0.35);
}

textarea::placeholder {
    color: #6c757d;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
}

.char-count.warning {
    color: #ff6b6b;
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 14px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ccd6f6;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 1000;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: rgba(100, 255, 218, 0.3);
    color: #64ffda;
}

.toast.error {
    border-color: rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
}

.question-display {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-display.empty {
    color: #6c757d;
    text-align: center;
    font-size: 14px;
}

.question-display .q-text {
    font-size: 16px;
    color: #e0e0e0;
    line-height: 1.7;
    word-break: break-word;
}

.question-display .q-meta {
    font-size: 12px;
    color: #6c757d;
    margin-top: 10px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-bar {
    text-align: center;
    font-size: 13px;
    color: #6c757d;
    padding: 8px 0;
}

.status-bar.online {
    color: #64ffda;
}

.status-bar.offline {
    color: #ff6b6b;
}

@media (max-width: 480px) {
    header h1 {
        font-size: 22px;
    }
    .card {
        padding: 20px;
        border-radius: 18px;
    }
    textarea {
        font-size: 16px;
    }
}
/* ==================== 新增：查看我的问题区域 ==================== */
.card-desc {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 16px;
    margin-top: -8px;
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.input-code {
    flex: 1;
    padding: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.25);
    color: #e0e0e0;
    font-size: 15px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.25s ease;
}

.input-code:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(0, 0, 0, 0.35);
}

.input-code::placeholder {
    color: #6c757d;
    text-transform: none;
    letter-spacing: normal;
}

.input-row .btn-secondary {
    margin-top: 0;
    width: auto;
    padding: 14px 24px;
    white-space: nowrap;
}

/* ==================== 新增：模态框样式 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    font-size: 18px;
    color: #ccd6f6;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.modal-body {
    padding: 24px;
}

.modal-tip {
    color: #8892b0;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-item {
    margin-bottom: 20px;
}

.modal-item label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-copy-row {
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-link {
    flex: 1;
    color: #64ffda;
    font-size: 13px;
    text-decoration: none;
    word-break: break-all;
    line-height: 1.5;
}

.modal-link:hover {
    text-decoration: underline;
}

.modal-code {
    flex: 1;
    color: #fed6e3;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 4px;
}

.btn-copy {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #a8b2d1;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy:hover {
    background: rgba(102, 126, 234, 0.35);
    color: #e0e0e0;
}

.modal-hint {
    color: #4a5568;
    font-size: 13px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==================== 移动端适配补充 ==================== */
@media (max-width: 480px) {
    .input-row {
        flex-direction: column;
    }
    
    .input-row .btn-secondary {
        width: 100%;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .modal-copy-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-copy {
        align-self: flex-end;
    }
}
/* ====== UI优化 ====== */

body {
    background-attachment: fixed;
}

.toast {
    z-index: 3000;
}

.card {
    transition: all .3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0,0,0,.35);
}

.input-code {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
}

.modal-link {
    overflow-wrap: break-word;
    word-break: break-word;
}

.answer-box {
    animation: fadeIn .4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* =======================================================
   守夜人阿墨（仅桌面端显示）
   图片：1.png
   设计目标：
   - 不抢主内容
   - 提供陪伴感
   - 小屏幕完全隐藏
======================================================= */

.mascot-card {

    position: fixed;

    right: 24px;
    bottom: 24px;

    width: 260px;

    background: rgba(255,255,255,.95);

    border-radius: 20px;

    overflow: hidden;

    box-shadow:
        0 15px 45px rgba(0,0,0,.25);

    z-index: 999;

    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.mascot-card:hover {

    transform: translateY(-3px);

    box-shadow:
        0 20px 55px rgba(0,0,0,.35);
}

/* 卡片文字区域 */

.mascot-content {

    padding: 18px;
}

/* 标题 */

.mascot-name {

    color: #302b63;

    font-size: 14px;

    font-weight: 700;

    margin-bottom: 8px;
}

/* 提示语 */

.mascot-text {

    color: #555;

    font-size: 13px;

    line-height: 1.6;
}

/* 熊插画 */

.mascot-image {

    width: 100%;

    display: block;

    background: #fff;
}

/* =======================================================
   响应式
   小于 1024px（平板）
   直接隐藏
======================================================= */

@media (max-width: 1024px) {

    .mascot-card {

        display: none;
    }
}