:root {
    --primary: #007AFF;
    --primary-hover: #0056CC;
    --secondary: #34C759;
    --secondary-hover: #2CA64A;
    --accent: #FF3B30;
    --accent-hover: #D32B20;
    --background: #F5F5F7;
    --surface: #FFFFFF;
    --surface-dark: #F2F2F7;
    --text: #1D1D1F;
    --text-secondary: #8E8E93;
    --text-light: #FFFFFF;
    --border: #C7C7CC;
    --border-light: #E5E5EA;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-dark: rgba(0, 0, 0, 0.12);
    --success: #34C759;
    --error: #FF3B30;
    --warning: #FF9500;
}

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

body {
    font-family: -apple-system, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.logo-text {
    font-weight: 700;
    font-size: 28px;
    color: var(--text);
}

.tagline {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* 主容器样式 */
.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* 卡片样式 */
.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 12px var(--shadow);
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

/* 输入区域样式 */
.input-area {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text);
    font-size: 15px;
}

.input-textarea {
    width: 100%;
    min-height: 160px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    resize: vertical;
    transition: all 0.2s ease;
}

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

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: 14px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
    background: var(--surface);
}

.file-upload-area:hover, .file-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(0, 122, 255, 0.03);
}

.upload-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.upload-subtext {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* 文件信息显示 */
.file-info-container {
    margin-top: 20px;
    animation: slideUp 0.2s ease;
}

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

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.file-extension {
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--surface-dark);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-dark);
    border-color: var(--primary);
}

.btn-success {
    background: var(--secondary);
    color: white;
}

.btn-success:hover {
    background: var(--secondary-hover);
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-hover);
}

.btn-full {
    width: 100%;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* 加密信息卡片 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.info-item {
    background: var(--surface);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.info-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    font-family: 'SF Mono', monospace;
}

/* 状态消息 */
.status-container {
    margin-bottom: 20px;
    min-height: 56px;
}

.status-message {
    padding: 16px;
    border-radius: 12px;
    animation: slideIn 0.2s ease;
    background: var(--surface);
    border-left: 4px solid;
    box-shadow: 0 2px 8px var(--shadow);
}

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

.status-success {
    border-left-color: var(--success);
}

.status-error {
    border-left-color: var(--error);
}

.status-info {
    border-left-color: var(--primary);
}

.status-text {
    font-weight: 600;
    font-size: 14px;
}

/* 进度指示器 */
.progress-container {
    margin: 20px 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.progress-label {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.progress-percent {
    font-weight: 700;
    color: var(--primary);
    font-family: 'SF Mono', monospace;
    font-size: 14px;
}

.progress-bar {
    height: 6px;
    background: var(--surface-dark);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border-light);
    margin-top: 30px;
}

.footer-main {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 14px;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-10px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    margin-bottom: 18px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.modal-body {
    margin-bottom: 22px;
}

.modal-text {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.file-extension-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-extension-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.modal-actions {
    display: flex;
    gap: 10px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .main-container {
        gap: 20px;
    }
    
    .card {
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .app-container {
        padding: 16px;
    }
    
    .card {
        padding: 18px 16px;
    }
    
    .file-upload-area {
        padding: 28px 16px;
    }
    
    .btn {
        padding: 13px 20px;
        font-size: 14px;
    }
    
    .input-textarea {
        min-height: 140px;
        padding: 14px;
    }
}

/* 加密结果区域 */
.encrypt-result {
    display: none;
    animation: fadeIn 0.2s ease;
}

.encrypt-result.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 清除按钮 */
.clear-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
    font-size: 14px;
    font-weight: 600;
}

.clear-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.card {
    position: relative;
}

/* 操作提示 */
.hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    line-height: 1.4;
}

/* 文本计数器 */
.text-counter {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 6px;
}

.text-counter.warning {
    color: var(--warning);
}

.text-counter.error {
    color: var(--error);
}

/* 简洁图标替代 */
.icon-close:before {
    content: "×";
}

.icon-download:before {
    content: "↓";
}

.icon-refresh:before {
    content: "↻";
}
