/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #007aff;
    --success-color: #34c759;
    --warning-color: #ff9500;
    --danger-color: #ff3b30;
    --dark-bg: #1a1a1a;
    --light-bg: #f2f2f7;
    --text-primary: #000000;
    --text-secondary: #666666;
    --border-color: #c7c7cc;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* 验证页面样式 */
.auth-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
    animation: slideIn 0.3s ease;
}

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

.auth-step h2 {
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.step-description {
    color: #666;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: 25px;
}

.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input {
    width: 100%;
    padding: 15px 120px 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f8f9fa;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.input-suffix {
    position: absolute;
    right: 15px;
    color: #666;
    font-size: 14px;
    pointer-events: none;
}

.hint {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

/* 按钮样式 */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), #0056d6);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #ccc;
}

.btn-primary.loading .btn-text {
    visibility: hidden;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 验证码输入样式 */
.code-inputs {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.code-input {
    width: 50px;
    height: 60px;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    background: white;
    transition: all 0.3s;
}

.code-input.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.code-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.countdown {
    color: var(--success-color);
    font-size: 14px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 14px;
}

.btn-link:disabled {
    color: #999;
    cursor: not-allowed;
}

/* 虚拟键盘样式 */
.virtual-keyboard {
    background: #f5f5f7;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.key {
    flex: 1;
    height: 60px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.key:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.key:active {
    transform: translateY(0);
}

.key-special {
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    gap: 8px;
}

/* 验证中样式 */
.verifying {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.verifying.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 122, 255, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.auth-footer {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.8);
}

.tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* 终端页面样式 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.current-dir {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.9rem;
}

.theme-dropdown {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.theme-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-email {
    color: #666;
    font-size: 14px;
}

.btn-logout {
    padding: 8px 16px;
    background: linear-gradient(135deg, #ff3b30, #d70015);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 59, 48, 0.4);
}

/* 终端容器 */
.terminal-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.terminal-window {
    display: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    height: 600px;
}

.terminal-window.active {
    display: block;
}

/* Basic主题 (Mac终端) */
.terminal-header {
    background: #e0e0e0;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.control.close { background: #ff5f56; }
.control.minimize { background: #ffbd2e; }
.control.maximize { background: #27ca3f; }

.terminal-title {
    color: #333;
    font-size: 13px;
    flex: 1;
    text-align: center;
}

.terminal-body {
    background: #000;
    color: #fff;
    padding: 20px;
    height: calc(100% - 40px);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    overflow-y: auto;
}

.output {
    margin-bottom: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

.input-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompt {
    color: #33ff33;
    font-weight: bold;
}

.cmd-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.cmd-input::placeholder {
    color: #666;
}

/* Homebrew主题 */
.homebrew-header {
    background: #2d2d2d;
}

.homebrew-controls .control {
    opacity: 0.8;
}

.homebrew-body {
    background: #1a1a1a;
    color: #e6e6e6;
}

.homebrew-input {
    color: #f08d49;
}

.homebrew-prompt {
    color: #f08d49;
}

.homebrew-path {
    color: #7ec699;
}

.homebrew-cmd {
    color: #e6e6e6;
}

/* Colorful主题 (宝塔风格) */
.colorful-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.colorful-controls .control {
    background: rgba(255, 255, 255, 0.3);
}

.colorful-title {
    color: white;
    font-weight: bold;
}

.colorful-body {
    background: #1e1e1e;
    padding: 0;
}

.colorful-info-bar {
    background: #2d2d2d;
    padding: 10px 20px;
    display: flex;
    gap: 20px;
    color: #aaa;
    font-size: 12px;
}

.colorful-info-bar span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.colorful-output {
    padding: 20px;
    color: #d4d4d4;
}

.colorful-input-line {
    background: #252526;
    padding: 15px 20px;
    border-top: 1px solid #3e3e42;
}

.colorful-prompt {
    display: flex;
    align-items: center;
    gap: 2px;
}

.colorful-user {
    color: #569cd6;
}

.colorful-path {
    color: #ce9178;
}

.colorful-symbol {
    color: #d4d4d4;
}

.colorful-cmd {
    color: #9cdcfe;
}

/* 状态栏 */
.status-bar {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    color: #666;
    font-size: 12px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 通知提示 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    gap: 15px;
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification-icon {
    font-size: 20px;
}

.notification-icon.success { color: var(--success-color); }
.notification-icon.error { color: var(--danger-color); }
.notification-icon.warning { color: var(--warning-color); }

.notification-text {
    color: #333;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

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

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