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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: url('imgs/background.png') center center no-repeat;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
    height: 100vh;
    padding: 2vh 2vw;
    padding-top: 10vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    position: relative;
    overflow-y: auto;
}

/* 顶部导航菜单 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 15px 20px;
    z-index: 1001;
    background: transparent;
}

.nav-dropdown {
    position: relative;
}

.nav-title {
    color: white;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.nav-dropdown:hover .nav-title {
    color: rgba(255, 255, 255, 0.9);
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    backdrop-filter: blur(10px);
    border-radius: 8px;
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    font-weight: 500;
}

.dropdown-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: #667eea;
    transition: width 0.3s ease;
}

.dropdown-item:hover {
    color: rgba(255, 255, 255, 1);
    background: transparent;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.dropdown-item:hover::after {
    width: 80%;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* 标题固定在网页最左上角 */
.main-title {
    position: fixed;
    top: 0;
    left: 0;
    color: white;
    font-size: 1.3em;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1002;
    margin: 0;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-logo {
    height: 1.95em;
    width: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.container {
    max-width: min(90vw, 900px);
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2vh;
    max-height: calc(100vh - 14vh);
    overflow: visible;
}

/* 主内容区域：包含存储统计、输入框和提示 */
.main-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

/* 存储统计横向排列 */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    flex: 1;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 0;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.stat-card h3 {
    color: #667eea;
    margin-bottom: 12px;
    font-size: 1.1em;
    font-weight: 600;
}

.stat-info p {
    margin: 6px 0;
    color: #555;
    font-size: 0.95em;
}

.stat-info span {
    font-weight: bold;
    color: #667eea;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

/* 命令输入区域 */
.command-section {
    width: 100%;
}

.input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

#command-input {
    width: 100%;
    padding: 16px 60px 16px 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: left;
}

#command-input::placeholder {
    color: #999;
    text-align: left;
}

#command-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.3);
    background: white;
}

/* 通用图标按钮样式 */
.icon-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 50%;
    outline: none;
}

.icon-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn:focus {
    outline: none;
}

/* 刷新按钮容器 */
.refresh-btn-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 20px 0 15px 0;
}

#refresh-btn svg,
#help-btn svg {
    width: 24px;
    height: 24px;
}

/* 输入框内的提交按钮 */
#submit-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#submit-btn:hover {
    transform: translateY(-50%) scale(1.1);
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

#submit-btn:active {
    transform: translateY(-50%) scale(0.95);
}

#submit-btn svg {
    width: 20px;
    height: 20px;
}

/* 响应区域 */
.response-area {
    min-height: 40px;
    padding: 8px 0;
    text-align: center;
}

.response-message {
    padding: 8px 16px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
    text-align: center;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    display: inline-block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.response-success {
    background: rgba(212, 237, 218, 0.9);
    color: #155724;
}

.response-error {
    background: rgba(248, 215, 218, 0.9);
    color: #721c24;
}

.response-warning {
    background: rgba(255, 243, 205, 0.9);
    color: #856404;
}

.response-info {
    background: rgba(209, 236, 241, 0.9);
    color: #0c5460;
}

/* 历史记录独立组件 - 固定大小不随内容变化 */
.history-section {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 350px;
    max-height: 350px;
    display: flex;
    flex-direction: column;
}

.history-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
    flex-shrink: 0;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.history-item {
    padding: 14px;
    margin: 10px 0;
    background: #f5f5f5;
    border-radius: 12px;
    border-left: 3px solid #667eea;
    animation: slideIn 0.3s ease;
    text-align: left;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

.history-item .time {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 6px;
}

.history-item .command {
    font-family: 'Courier New', monospace;
    color: #333;
    font-weight: 600;
    margin-bottom: 4px;
}

.history-item .result {
    font-size: 0.9em;
}

/* 滚动条样式 - 全局默认 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 历史记录区域的滚动条 */
.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.2);
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.4);
}

/* 项目介绍弹窗样式 */
.modal-body ul {
    list-style: none;
    padding-left: 0;
    margin: 15px 0;
}

.modal-body ul li {
    padding: 8px 0;
    line-height: 1.6;
    color: #555;
}

.modal-body ul li strong {
    color: #667eea;
}

.modal-body p {
    line-height: 1.8;
    color: #555;
    margin: 10px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding-top: 12vh;
    }

    .nav-brand-text {
        font-size: clamp(0.8em, 2vw, 1em);
    }

    .nav-logo {
        height: 2em;
    }

    .nav-menu {
        gap: 4vw;
    }

    .nav-title {
        font-size: 0.95em;
        padding: 0.5vh 1vw;
    }

    .container {
        max-width: 95vw;
        margin-top: 1vh;
    }

    .stats-row {
        flex-direction: column;
        gap: 2vh;
    }

    .stat-card {
        width: 100%;
    }

    #command-input {
        padding: 1.5vh 10vw 1.5vh 4vw;
        font-size: 0.95em;
    }

    .main-content {
        padding: 3vh 4vw;
    }

    .history-section {
        padding: 3vh 4vw;
        min-height: 300px;
        max-height: 300px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 1.5vh 3vw;
        padding-top: 14vh;
    }

    .nav-brand-text {
        display: none;
    }

    .nav-logo {
        height: 1.8em;
    }

    .nav-menu {
        gap: 5vw;
    }

    .container {
        margin-top: 0.5vh;
    }

    .main-content {
        padding: 2vh 3vw;
    }

    #command-input {
        padding: 1.2vh 12vw 1.2vh 3vw;
        font-size: 0.9em;
    }

    .history-section {
        padding: 2vh 3vw;
        min-height: 250px;
        max-height: 250px;
    }
}

/* 帮助弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.4em;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    color: #888;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-body h3 {
    color: #667eea;
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 1.2em;
    font-weight: 600;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body pre {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
    overflow-x: auto;
    margin: 10px 0;
}

.modal-body code {
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    color: #333;
}

/* 弹窗内容区域的滚动条 */
.modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.2);
    border-radius: 2px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.4);
}

/* 响应式弹窗 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h2 {
        font-size: 1.2em;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-body h3 {
        font-size: 1.1em;
    }

    .modal-body pre {
        padding: 12px;
        font-size: 0.9em;
    }
}