/* 剪切板页面样式 - 与门户/API 调试页统一风格 */

:root {
    --bg: #f6f7fb;
    --card-bg: #ffffff;
    --border: #e8eaf1;
    --title: #171c2e;
    --muted: #6b7488;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--title);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

.container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(23, 28, 46, 0.06);
    padding: 28px;
    max-width: 640px;
    width: 100%;
    animation: fadeIn 0.4s ease;
}

h1 {
    text-align: center;
    color: var(--title);
    margin-bottom: 22px;
    font-size: 26px;
    font-weight: 800;
}

/* Tab 切换 */
.tab-container {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f1f3f9;
    padding: 6px;
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--muted);
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--title);
}

.tab-btn.active {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.14);
}

/* 表单区域 */
.form-section {
    background: #fbfbfe;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    min-height: 380px;
    transition: opacity 0.3s ease;
}

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--title);
    font-weight: 600;
    font-size: 13px;
}

input[type="text"] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--title);
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--title);
    background: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    resize: vertical;
    min-height: 100px;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* 按钮组 */
.button-group {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

button {
    flex: 0 0 auto;
    padding: 9px 16px;
    border: 1px solid #e3e6f0;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #3f4658;
    background: #f2f4fa;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

button:hover {
    background: #e8ebf5;
    border-color: #d5dae8;
}

/* 主操作：淡紫 */
.btn-query,
.btn-set,
.btn-append {
    background: #eef0ff;
    color: var(--accent);
    border-color: #dfe3ff;
}
.btn-query:hover,
.btn-set:hover,
.btn-append:hover {
    background: #e2e6ff;
    border-color: #ccd2ff;
}

/* 复制：淡绿 */
.btn-copy {
    background: #e8f8ee;
    color: #15803d;
    border-color: #c9ecd4;
}
.btn-copy:hover {
    background: #d9f2e2;
    border-color: #b5e3c3;
}

/* 撤回：淡琥珀 */
.btn-undo {
    background: #fdf3e3;
    color: #b45309;
    border-color: #f5e0bb;
}
.btn-undo:hover {
    background: #fbe9cd;
    border-color: #f0d3a0;
}

/* 刷新：中性灰 */
.btn-refresh {
    background: #f2f4fa;
    color: #3f4658;
    border-color: #e3e6f0;
}
.btn-refresh:hover {
    background: #e8ebf5;
    border-color: #d5dae8;
}

/* 清空：淡红 */
.btn-clear {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fbdcdc;
}
.btn-clear:hover {
    background: #fee4e4;
    border-color: #f7c9c9;
}

.btn-bookmarklet {
    flex: 0 0 auto;
    padding: 9px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    cursor: move;
    transition: background 0.18s ease, border-color 0.18s ease;
    background: #e5f7fb;
    color: #0e7490;
    border: 1px solid #c0ecf3;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-bookmarklet:hover {
    background: #d3f1f7;
    border-color: #a8e3ee;
}

.links-display {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.8;
}

/* 结果展示 */
.result-container {
    margin-top: 18px;
}

.result-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.result-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.result-content {
    color: var(--title);
    font-size: 14px;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.7;
    min-height: 100px;
}

/* Toast 提示 */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(23, 28, 46, 0.16);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.toast-success { background: #10b981; color: #fff; }
.toast-error { background: #ef4444; color: #fff; }

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    word-break: break-word;
}

.loading {
    display: none;
    text-align: center;
    color: var(--accent);
    margin-top: 20px;
}

.loading.show {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 3px solid #eef0f8;
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 移动端适配 */
@media (max-width: 640px) {
    body {
        padding: 20px 12px;
    }

    .container {
        padding: 18px 14px;
        border-radius: 14px;
    }

    h1 {
        font-size: 22px;
    }

    .tab-btn {
        font-size: 13px;
        padding: 9px 8px;
    }

    .form-section {
        padding: 16px;
        min-height: 320px;
    }

    #toastContainer {
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }
}
