/* 移动端优先的简约商务风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --text-color: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-color: #e0e0e0;
    --bg-color: #ffffff;
    --bg-grey: #fafafa;
    --success-color: #059669;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}

/* 头部 - 移动端优化 */
.header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: stretch;
    min-height: 56px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 50%;
    height: 56px;
    padding: 0;
}

.logo-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    object-position: left center;
    display: block;
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 50%;
    padding: 0 16px;
}

.company-name {
    font-size: 17px;
    font-weight: 900;
    font-family: 'Microsoft YaHei', 'SimHei', '黑体', sans-serif;
    color: #000000;
    letter-spacing: 0.5px;
}

.system-name {
    font-size: 13px;
    font-weight: 400;
    color: #000000;
}

.system-name-large {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
    letter-spacing: 0.5px;
}

/* 容器 - 移动端优化 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    min-height: calc(100vh - 57px);
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading p {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 15px;
}

/* 标题 */
.section-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
    letter-spacing: -0.3px;
}

/* 模板列表 - 移动端优化 */
.templates-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.template-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 8px;
    min-height: 100px;
}

.template-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.template-card:active {
    background: var(--bg-grey);
}

.template-card::before {
    transform: scaleY(1);
}

.template-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.template-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
}

.template-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.template-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    gap: 12px;
}

.template-id {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
    flex: 1;
    min-width: 0;
}

.id-label {
    flex-shrink: 0;
}

.id-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.select-arrow {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 26, 0.95);
    color: var(--bg-color);
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 15px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

/* 步骤指示器 - 移动端优化 */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    padding: 24px 0 16px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 400;
    color: #999;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.step-item.completed .step-number {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.step-label {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: 500;
}

.step-item.completed .step-label {
    color: #666;
}

.step-line {
    width: 40px;
    height: 1px;
    background: #e0e0e0;
    margin: 0 8px;
}

/* 步骤内容 */
.step-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

.step-header {
    margin-bottom: 24px;
}

.step-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* 表单字段 - 移动端优化 */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 表单组 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-label.required::after {
    content: '*';
    color: #ef4444;
    font-size: 15px;
}

.form-hint {
    font-size: 13px;
    color: var(--text-light);
    margin-top: -4px;
    line-height: 1.6;
}

/* 输入控件 - 移动端优化，增大触摸区域 */
.form-input,
.form-select,
.form-textarea {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    color: var(--text-color);
    background: white;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #ccc;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* 参与方卡片 - 移动端优化 */
.actor-card {
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
}

.actor-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.actor-id {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.actor-badge {
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 400;
    color: #666;
    background: var(--bg-grey);
    border-radius: 4px;
}

.actor-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 控件卡片 - 移动端优化 */
.field-card {
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 16px;
    background: white;
    border-radius: 8px;
}

.field-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.field-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
}

.field-type {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 步骤操作按钮 - 移动端优化，增大按钮 */
.step-actions {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn {
    width: 100%;
    padding: 16px 32px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    color: var(--text-color);
    -webkit-appearance: none;
}

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

.btn-primary:active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

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

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

.btn-secondary:active {
    background: var(--bg-grey);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* 桌面端优化 */
@media (min-width: 768px) {
    .container {
        padding: 60px 40px;
    }
    
    .header-content {
        padding: 0;
        min-height: 72px;
    }
    
    .logo-container {
        height: 72px;
        width: 50%;
        padding: 0;
    }
    
    .logo-img {
        width: 100%;
        height: 100%;
        max-width: 100%;
        object-fit: cover;
        object-position: left center;
    }
    
    .header-text {
        width: 50%;
    }
    
    .company-name {
        font-size: 20px;
    }
    
    .system-name {
        font-size: 16px;
    }
    
    .templates-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 24px;
    }

    .template-card:hover {
        border-color: var(--primary-color);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    }

    .template-card:hover::before {
        transform: scaleY(1);
    }

    .template-card:active {
        transform: scale(0.99);
    }
    
    .section-title {
        font-size: 26px;
        margin-bottom: 32px;
    }

    .step-indicator {
        padding: 40px 0 20px;
        margin-bottom: 48px;
    }

    .step-line {
        width: 100px;
        margin: 0 16px;
    }

    .step-number {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .step-label {
        font-size: 14px;
    }

    .step-content {
        padding: 0 20px;
    }

    .step-header h2 {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .step-header {
        margin-bottom: 40px;
    }

    .form-fields {
        gap: 28px;
    }

    .actor-card,
    .field-card {
        padding: 28px;
    }

    .step-actions {
        flex-direction: row;
        justify-content: center;
        margin-top: 56px;
        padding-top: 32px;
    }

    .btn {
        width: auto;
        min-width: 160px;
        padding: 14px 36px;
    }
}

/* 超大屏幕优化 */
@media (min-width: 1024px) {
    .step-line {
        width: 120px;
        margin: 0 20px;
    }
}

/* 密码验证弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-color);
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-color);
    outline: none;
    transition: border-color 0.2s ease;
    margin-bottom: 20px;
}

.modal-input:focus {
    border-color: var(--primary-color);
}

.modal-input::placeholder {
    color: var(--text-light);
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-buttons .btn {
    flex: 1;
    max-width: 120px;
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
    }
    
    .modal-buttons .btn {
        max-width: none;
    }
}
