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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 头部样式 */
.header {
    background-color: #2c3e50;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.logo i {
    font-size: 24px;
    color: #e74c3c;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: #bdc3c7;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background-color: #3498db;
    color: white;
}

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

.user-name {
    font-size: 14px;
}

.logout-btn {
    background: none;
    border: none;
    color: #bdc3c7;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 24px;
    margin-bottom: 5px;
    color: #2c3e50;
}

.page-header p {
    color: #7f8c8d;
    font-size: 14px;
}

/* 盖章页面样式 */
.stamp-workspace {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 20px;
    height: calc(100vh - 180px);
}

/* 左侧面板 */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-section {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.upload-section h3 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.upload-section .upload-area {
    padding: 15px;
}

.upload-section .upload-area i {
    font-size: 28px;
}

.upload-section .upload-area p {
    font-size: 12px;
}

.toolbar {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

.tool-section {
    margin-bottom: 25px;
}

.tool-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.upload-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-area:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

.upload-area i {
    font-size: 36px;
    color: #3498db;
    margin-bottom: 10px;
}

.upload-area p {
    margin-bottom: 5px;
}

.supported-formats {
    font-size: 12px;
    color: #7f8c8d;
}

#file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.stamp-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stamp-selector select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.stamp-properties {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.property-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.property-group label {
    font-size: 14px;
    font-weight: 500;
}

.property-group input[type="range"] {
    width: 100%;
}

.property-group span {
    font-size: 12px;
    color: #7f8c8d;
    text-align: right;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cross-page-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cross-page-controls .btn {
    font-size: 13px;
    padding: 8px 12px;
}

.cross-page-controls .btn.active {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.cross-page-seal {
    pointer-events: all;
    cursor: move;
    overflow: hidden;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

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

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

.btn-info {
    background-color: #1abc9c;
    color: white;
}

.btn-info:hover {
    background-color: #16a085;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.canvas-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
}

.canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background: #e8e8e8;
}

#document-canvas {
    border: 1px solid #ddd;
    transform-origin: 0 0;
}

#stamp-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    transform-origin: 0 0;
}

.stamp-element {
    position: absolute;
    cursor: move;
    pointer-events: all;
    user-select: none;
}

.stamp-element img {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.canvas-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

.zoom-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background-color: #f1f1f1;
}

.zoom-level {
    font-size: 14px;
    color: #7f8c8d;
    min-width: 50px;
    text-align: center;
}

/* PDF 分页控件样式 */
.pdf-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

.page-nav-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    color: #2c3e50;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-nav-btn:hover {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.page-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-nav-btn:disabled:hover {
    background-color: white;
    color: #2c3e50;
    border-color: #ddd;
}

.pdf-pagination .page-info {
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.page-input {
    width: 50px;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    outline: none;
}

.page-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.file-list {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

.file-list h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.file-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.file-item {
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-item.active {
    border-color: #3498db;
    background-color: rgba(52, 152, 219, 0.05);
}

.file-item i {
    font-size: 18px;
    color: #3498db;
}

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

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

.file-size {
    font-size: 12px;
    color: #7f8c8d;
}

.file-remove {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.file-remove:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

/* 模板页面样式 */
.templates-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.templates-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 8px 35px 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-box i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.template-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.template-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.template-preview {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
}

.template-preview img {
    max-width: 100%;
    max-height: 100%;
}

.template-info {
    padding: 15px;
}

.template-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
}

.template-type {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

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

.template-actions button {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-btn {
    background-color: #3498db;
    color: white;
}

.edit-btn:hover {
    background-color: #2980b9;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.template-company {
    font-size: 12px;
    color: #3498db;
    margin-bottom: 3px;
    font-weight: 500;
}

.stamp-filter-group {
    margin-bottom: 15px;
}

.stamp-filter-group label {
    display: block;
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.stamp-filter-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.stamp-filter-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* 页面尺寸选择器 */
.page-size-selector {
}

.page-size-selector select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
}

.page-size-selector select:focus {
    outline: none;
    border-color: #3498db;
}

.page-size-hint {
    display: block;
    font-size: 12px;
    color: #95a5a6;
    margin-top: 6px;
}

.image-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.image-upload-area:hover {
    border-color: #3498db;
    background-color: #f0f7ff;
}

.image-upload-area.dragover {
    border-color: #3498db;
    background-color: #e8f4ff;
}

.image-upload-area i {
    font-size: 48px;
    color: #bdc3c7;
    margin-bottom: 10px;
}

.image-upload-area p {
    color: #7f8c8d;
    margin: 5px 0;
}

.image-upload-area .supported-formats {
    font-size: 12px;
    color: #95a5a6;
}

.required {
    color: #e74c3c;
    margin-left: 2px;
}

/* 历史记录页面样式 */
.history-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.history-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
}

.filter-group input,
.filter-group select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.history-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #2c3e50;
}

.history-table tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-success {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.status-failed {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.action-btn {
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.page-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background-color: #f1f1f1;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #7f8c8d;
}

/* 用户管理页面样式 */
.users-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.users-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.users-table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.users-table th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #2c3e50;
}

.users-table tr:hover {
    background-color: #f8f9fa;
}

.role-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.role-admin {
    background-color: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.role-user {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.role-viewer {
    background-color: rgba(149, 165, 166, 0.1);
    color: #95a5a6;
}

.status-active {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.status-inactive {
    background-color: rgba(149, 165, 166, 0.1);
    color: #95a5a6;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.login-modal {
    max-width: 400px;
}

/* 历史详情模态框样式 */
.history-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-item {
    display: flex;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.detail-label {
    font-weight: 500;
    width: 100px;
    color: #7f8c8d;
}

.detail-value {
    flex: 1;
    word-break: break-all;
}

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

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

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #2c3e50;
    background-color: #f8f9fa;
}

.modal-body {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

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

.form-group input[type="color"] {
    height: 40px;
    cursor: pointer;
}

.template-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
}

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

/* 提示消息样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 2000;
}

.toast.show {
    transform: translateX(0);
}

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

.toast.success i {
    color: #2ecc71;
}

.toast.error i {
    color: #e74c3c;
}

.toast.warning i {
    color: #f39c12;
}

.toast.info i {
    color: #3498db;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .stamp-workspace {
        grid-template-columns: 200px 1fr 200px;
    }
}

@media (max-width: 992px) {
    .stamp-workspace {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .left-panel {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .upload-section,
    .file-list {
        flex: 1;
        min-width: 250px;
    }
    
    .toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .tool-section {
        flex: 1;
        min-width: 200px;
    }
    
    .file-list {
        max-height: 250px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    
    .nav-menu {
        margin: 10px 0;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .templates-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .history-filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .users-toolbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-box {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-item {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
    }
}

/* 移动端优化 - 增强版 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .header {
        position: relative;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .logo h1 {
        font-size: 16px;
    }
    
    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: space-around;
        display: none;
    }
    
    .nav-menu.show {
        display: flex;
    }
    
    .nav-item {
        flex: 1;
        justify-content: center;
        padding: 8px 5px;
        font-size: 12px;
    }
    
    .nav-item i {
        display: block;
        margin-bottom: 2px;
    }
    
    .user-info {
        order: 2;
    }
    
    .stamp-workspace {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 200px);
    }
    
    .left-panel {
        order: 1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .upload-section {
        flex: 1;
        min-width: 200px;
    }
    
    .file-list {
        flex: 1;
        min-width: 200px;
        max-height: 200px;
    }
    
    .canvas-container {
        order: 2;
        min-height: 400px;
    }
    
    .toolbar {
        order: 3;
        display: block;
        padding: 15px;
    }
    
    .tool-section {
        margin-bottom: 15px;
    }
    
    .tool-section h3 {
        font-size: 14px;
    }
    
    .upload-area {
        padding: 15px;
    }
    
    .upload-area i {
        font-size: 24px;
    }
    
    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .action-buttons .btn {
        flex: 1;
        min-width: calc(50% - 5px);
        font-size: 12px;
        padding: 8px 10px;
    }
    
    .page-header h2 {
        font-size: 18px;
    }
    
    .templates-toolbar,
    .users-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .history-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .history-table th,
    .history-table td,
    .users-table th,
    .users-table td {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 85vh;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-group input,
    .form-group select {
        padding: 8px;
        font-size: 14px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .toast {
        left: 10px;
        right: 10px;
        top: 10px;
        transform: translateY(-120%);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 14px;
    }
    
    .nav-item {
        padding: 6px 3px;
        font-size: 11px;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item i {
        font-size: 16px;
        margin-bottom: 0;
    }
    
    .left-panel {
        flex-direction: column;
    }
    
    .upload-section,
    .file-list {
        min-width: 100%;
    }
    
    .upload-section .upload-area {
        padding: 10px;
    }
    
    .upload-section .upload-area i {
        font-size: 24px;
    }
    
    .canvas-container {
        min-height: 300px;
    }
    
    .canvas-controls {
        padding: 5px;
    }
    
    .zoom-btn {
        width: 28px;
        height: 28px;
    }
    
    .pdf-pagination {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
    }
    
    .page-nav-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .page-input {
        width: 40px;
        padding: 4px 6px;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .template-card {
        margin-bottom: 10px;
    }
    
    .template-preview {
        height: 120px;
    }
    
    .action-buttons .btn {
        min-width: 100%;
        margin-bottom: 5px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }
    
    .nav-item {
        min-height: 44px;
    }
    
    .file-item {
        min-height: 50px;
    }
    
    .zoom-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .page-nav-btn {
        min-height: 44px;
    }
    
    .form-group input,
    .form-group select {
        min-height: 44px;
    }
    
    .upload-area {
        min-height: 100px;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .stamp-workspace {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .left-panel {
        order: 1;
        width: 30%;
        flex-direction: column;
    }
    
    .canvas-container {
        order: 2;
        width: 70%;
        min-height: 300px;
    }
    
    .toolbar {
        order: 3;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }
    
    .tool-section {
        flex: 1;
        min-width: 200px;
    }
}

/* 打印样式 */
@media print {
    .header,
    .toolbar,
    .file-list,
    .nav-menu,
    .user-info,
    .toast {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .canvas-container {
        box-shadow: none;
        border: none;
    }
}