/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

/* 按钮样式 */
button {
    cursor: pointer;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
}

.btn-secondary {
    background-color: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background-color: #0b7dda;
}

.btn-danger {
    background-color: #f44336;
    color: white;
}

.btn-danger:hover {
    background-color: #da190b;
}

.btn-add {
    background-color: #4CAF50;
    color: white;
    font-size: 12px;
    padding: 6px 12px;
}

.btn-logout {
    background-color: #ff5722;
    color: white;
}

.btn-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
}

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

/* 登录页面 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4CAF50;
}

.login-box button[type="submit"] {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
}

.login-hint {
    text-align: center;
    margin-top: 20px;
    color: #999;
    font-size: 12px;
}

/* 主界面 */
.main-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.header h1 {
    font-size: 20px;
    color: #333;
}

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

.user-info span {
    color: #666;
}

.btn-api-docs {
    background-color: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-api-docs:hover {
    background-color: #5568d3;
}

.btn-api-docs {
    background-color: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-api-docs:hover {
    background-color: #5568d3;
}

.content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 320px;
    padding: 18px;
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 45%, #f5f7fa 100%);
    border-right: 1px solid #dde4f0;
}

.sidebar-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 22px;
    box-shadow: 0 14px 36px rgba(99, 102, 241, 0.10);
    overflow: hidden;
}

.sidebar-header {
    padding: 22px 20px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(244, 247, 255, 0.78) 100%);
}

.sidebar-heading {
    margin-bottom: 18px;
}

.sidebar-eyebrow {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6366f1;
}

.sidebar-header h3 {
    margin-bottom: 8px;
    font-size: 22px;
    font-weight: 700;
    color: #172033;
}

.sidebar-subtitle {
    font-size: 13px;
    line-height: 1.6;
    color: #64748b;
}

.product-tree {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
}

.product-tree::-webkit-scrollbar {
    width: 8px;
}

.product-tree::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.22);
    border-radius: 999px;
}

.product-item {
    margin-bottom: 12px;
}

.product-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    cursor: pointer;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 100%);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.product-header:hover {
    transform: translateY(-1px);
    border-color: rgba(99, 102, 241, 0.24);
    box-shadow: 0 16px 28px rgba(99, 102, 241, 0.09);
}

.product-header.active {
    background: linear-gradient(180deg, #ffffff 0%, #f4f7ff 100%);
    border-color: rgba(99, 102, 241, 0.32);
    box-shadow: 0 18px 32px rgba(99, 102, 241, 0.13);
}

.product-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.product-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4f46e5;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.08);
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.product-header:hover .product-icon,
.product-header.active .product-icon {
    transform: scale(1.04);
    background: linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
}

.product-meta {
    flex: 1;
    min-width: 0;
}

.product-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.product-name {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    color: #172033;
}

.product-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 11px;
    font-weight: 700;
    margin: 0;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.product-description {
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, max-height 0.2s ease, transform 0.2s ease;
}

.product-header:hover .product-actions,
.product-header.active .product-actions {
    opacity: 1;
    max-height: 80px;
    transform: translateY(0);
}

.product-actions button,
.software-actions button {
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    box-shadow: none;
}

.software-list {
    margin-left: 0;
    margin-top: 10px;
    padding-left: 12px;
    border-left: 2px solid rgba(99, 102, 241, 0.10);
    display: none;
}

.software-list.show {
    display: block;
}

.software-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.08);
    background: rgba(255, 255, 255, 0.78);
    transition: all 0.2s ease;
}

.software-item:hover {
    background: #ffffff;
    border-color: rgba(99, 102, 241, 0.16);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05);
}

.software-item.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.08) 0%, rgba(255, 255, 255, 0.98) 100%);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 12px 20px rgba(99, 102, 241, 0.09);
}

.software-info {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.software-accent {
    width: 4px;
    min-height: 40px;
    border-radius: 999px;
    background: linear-gradient(180deg, #818cf8 0%, #4f46e5 100%);
    opacity: 0.14;
    transition: opacity 0.2s ease;
}

.software-item.active .software-accent,
.software-item:hover .software-accent {
    opacity: 1;
}

.software-meta {
    flex: 1;
    min-width: 0;
}

.software-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.software-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.software-id {
    font-size: 11px;
    color: #6366f1;
    background: #eef2ff;
    padding: 3px 8px;
    border-radius: 999px;
    font-family: monospace;
    white-space: nowrap;
}

.software-description {
    font-size: 12px;
    line-height: 1.45;
    color: #64748b;
}

.software-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.software-item:hover .software-actions,
.software-item.active .software-actions {
    opacity: 1;
    transform: translateX(0);
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.welcome-view {
    text-align: center;
    padding-top: 100px;
}

.welcome-view h2 {
    color: #666;
    margin-bottom: 10px;
}

.welcome-view p {
    color: #999;
}

/* 软件视图 */
.software-view {
    max-width: 1200px;
}

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

.software-desc {
    color: #666;
    margin-top: 5px;
}

.id-info {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.id-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.version-info {
    margin-bottom: 30px;
}

.version-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 15px;
}

.channel-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 14px;
}

.channel-filter select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
}

.version-info h3 {
    margin-bottom: 0;
    color: #333;
}

.version-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.version-card h4 {
    font-size: 24px;
    color: #4CAF50;
    margin-bottom: 10px;
}

.version-card p {
    color: #666;
    margin-bottom: 5px;
}

.version-history h3 {
    margin-bottom: 15px;
    color: #333;
}

/* 数据表格 */
.data-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.data-table thead {
    background-color: #f5f5f5;
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-warning {
    background-color: #fff3e0;
    color: #f57c00;
}

.badge-info {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* 模态框 */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-box {
    position: relative;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.modal-content {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: #4CAF50;
}

.toast.error {
    background: #f44336;
}

.toast.warning {
    background: #ff9800;
}

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

/* 文件上传 */
.file-upload {
    border: 2px dashed #ddd;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: #4CAF50;
    background-color: #f9f9f9;
}

.file-upload.dragover {
    border-color: #4CAF50;
    background-color: #e8f5e9;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 10px;
}

.file-upload-text {
    color: #666;
}

.file-name {
    margin-top: 10px;
    padding: 8px;
    background: #e8f5e9;
    border-radius: 4px;
    color: #2e7d32;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        padding: 20px;
    }

    .software-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* MD5 值样式 */
.md5-value {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    color: #606266;
    background-color: #f0f2f5;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
    word-break: break-all;
    user-select: all;
}

.md5-value:hover {
    background-color: #e6e8eb;
    color: #303133;
}
