/* ========================================
   文件权限密码去除工具 - 样式
   ======================================== */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --error: #dc2626;
    --error-light: #fee2e2;
    --warning: #d97706;
    --warning-light: #fef3c7;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.04);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: .2s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

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

.logo svg { color: var(--primary); flex-shrink: 0; }

.logo h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.logo p {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 2px;
}

.badges {
    display: flex;
    gap: 6px;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
}

/* Upload Section */
.upload-section {
    margin-bottom: 24px;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--card);
}

.drop-zone:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.01);
}

.drop-zone svg { color: var(--text-light); margin-bottom: 12px; transition: var(--transition); }
.drop-zone:hover svg, .drop-zone.drag-over svg { color: var(--primary); }

.drop-text {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 4px;
}

.drop-text .link { color: var(--primary); font-weight: 600; cursor: pointer; }

.drop-hint {
    font-size: 12px;
    color: var(--text-light);
}

/* Password Section */
.password-section {
    margin-top: 16px;
}

.password-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    transition: var(--transition);
}

.password-input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.password-input-wrap svg { color: var(--text-light); flex-shrink: 0; }

.password-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 11px 0;
    font-size: 14px;
    background: transparent;
    color: var(--text);
}

#toggle-password {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

#toggle-password:hover { color: var(--primary); }

/* File List */
.file-list-section {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 15px;
    font-weight: 600;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

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

.file-list {
    max-height: 360px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.file-item:last-child { border-bottom: none; }
.file-item:hover { background: #f8fafc; }

.file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: -.5px;
}

.file-icon.pdf  { background: #dc2626; }
.file-icon.docx { background: #2563eb; }
.file-icon.pptx { background: #d97706; }
.file-icon.xlsx { background: #16a34a; }
.file-icon.other { background: #64748b; }

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

.file-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

.file-status {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.file-status.pending { background: var(--bg); color: var(--text-light); }
.file-status.processing { background: var(--warning-light); color: var(--warning); }
.file-status.success { background: var(--success-light); color: var(--success); }
.file-status.error { background: var(--error-light); color: var(--error); }

.file-download {
    flex-shrink: 0;
}

.file-download a {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.file-download a:hover { color: var(--primary-hover); }

.file-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: var(--transition);
}

.file-remove:hover { color: var(--error); }

/* Action Bar */
.action-bar {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

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

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

/* Progress */
.progress-section {
    margin-top: 16px;
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    box-shadow: var(--shadow);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

#progress-text { font-weight: 500; }
#progress-count { color: var(--text-light); }

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

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

/* Footer */
.footer {
    margin-top: 32px;
    text-align: center;
}

.footer p {
    font-size: 12px;
    color: var(--text-light);
}

/* Summary Toast */
.summary-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideUp .3s ease;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to   { transform: translate(-50%, 0); opacity: 1; }
}

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 20px 14px 32px; }
    .logo h1 { font-size: 18px; }
    .drop-zone { padding: 32px 16px; }
    .file-item { padding: 12px 14px; gap: 10px; }
    .action-bar { flex-direction: column; }
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
}
