/* ---------- 页面基础 ---------- */
html,
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: auto;
    min-height: 100%;
    transition: color 0.3s;
}

/* ---------- 背景层 ---------- */
#bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: -1;
}

/* ---------- 顶部 header ---------- */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #e2e8f0;
    transition: transform 0.3s ease, background-color 0.3s, color 0.3s;
}

body.dark header {
    background-color: rgba(20, 20, 35, 0.8);
    border-bottom: 1px solid #444;
    color: #e2e8f0;
}

header.hidden {
    transform: translateY(-100%);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

header .controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 控件样式 */
header input,
header select {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 0.9rem;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.9);
    transition: background-color 0.3s, color 0.3s;
}

/* 主题切换按钮仅显示图标 */
#themeToggle {
    padding: 0;
    margin: 0;
    font-size: 1.4rem;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
}

/* ---------- 主内容 ---------- */
main {
    padding: 140px 1rem 2rem 1rem;
    max-width: 800px;
    margin: 0 auto;
}

/* ---------- 主卡片 ---------- */
.command-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    transition: background 0.3s, backdrop-filter 0.3s;
}

/* ---------- 每条命令 ---------- */
.command-item {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
}

.command-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.command {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(255, 255, 255, 0.45);
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    font-size: 0.95rem;
    word-break: break-all;
}

.purpose {
    color: burlywood;
}

/* ---------- 复制按钮 ---------- */
.copy-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    border: none;
    border-radius: 6px;
    background-color: #3b82f6;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s, opacity 0.2s;
    opacity: 0;
}

.command-item:hover .copy-btn {
    opacity: 1 !important;
}

.copy-btn:hover {
    background-color: #2563eb;
    transform: scale(1.05);
}

/* ---------- 日夜主题 ---------- */
body.light {
    color: #111;
}

body.dark {
    background-color: #1e1e2f;
    color: #e2e8f0;
}

body.light .command {
    background-color: rgba(255, 255, 255, 0.45);
    color: #1e293b;
}

body.light .copy-btn {
    background-color: #3b82f6;
    color: white;
}

body.light .copy-btn:hover {
    background-color: #2563eb;
}

body.dark .command-card {
    background-color: #2c2c44;
}

body.dark .command {
    background-color: #3b3b5a;
    color: #e2e8f0;
}

body.dark .copy-btn {
    background-color: #60a5fa;
    color: #111;
}

body.dark .copy-btn:hover {
    background-color: #2563eb;
}

/* ---------- 页脚 ---------- */
footer {
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #333333;
    margin-top: 2rem;
    z-index: 1;
}