/* 优象图纸管理系统 - 通用样式 */

/* ============================================================
 * 短代码嵌入页 (projects-page)
 * ============================================================ */
.dm-app {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    color: #333;
}

.dm-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.dm-toolbar-right { margin-left: auto; }

.dm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.15s;
}
.dm-btn-primary  { background: #1a73e8; color: #fff; }
.dm-btn-primary:hover { background: #1557b0; color: #fff; }
.dm-btn-primary:disabled { background: #9ec3f5; cursor: not-allowed; }
.dm-btn-secondary { background: #f1f3f4; color: #444; border: 1px solid #e0e0e0; }
.dm-btn-secondary:hover { background: #e8eaed; }
.dm-btn-ghost { background: transparent; color: #1a73e8; padding: 6px 10px; }
.dm-btn-ghost:hover { background: #e8f0fe; }
.dm-btn-sm { padding: 5px 10px; font-size: 12px; }

.dm-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 15px;
    opacity: 0.6;
    transition: opacity 0.15s, background 0.15s;
}
.dm-icon-btn:hover { opacity: 1; background: #f1f3f4; }

.dm-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    width: 100%;
    background: #fff;
}
.dm-input:focus { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26,115,232,.1); }

.dm-search {
    padding: 7px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    width: 200px;
}
.dm-search:focus { border-color: #1a73e8; }

/* 新建表单 */
.dm-create-form {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.dm-create-form h4 { font-size: 14px; margin-bottom: 12px; }
.dm-field-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.dm-field-row .dm-input { flex: 1; }
.dm-field-actions { display: flex; gap: 8px; }

/* 项目卡片 */
.dm-project-list { display: flex; flex-direction: column; gap: 8px; }

.dm-project-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.dm-project-card:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 8px rgba(26,115,232,.12);
}
.dm-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.dm-card-title { font-weight: 600; font-size: 14px; flex: 1; }
.dm-card-actions { display: flex; gap: 2px; }
.dm-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    flex-wrap: wrap;
}
.dm-dot { color: #ddd; }
.dm-card-desc {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
}

/* 空状态 / 加载 */
.dm-empty, .dm-loading {
    padding: 40px;
    text-align: center;
    color: #aaa;
    font-size: 13px;
}

/* 状态消息 */
.dm-status-msg {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}
.dm-status-success { background: #e6f4ea; color: #1e8e3e; }
.dm-status-error   { background: #fce8e6; color: #d93025; }
.dm-status-loading { background: #e8f0fe; color: #1a73e8; }

/* 项目详情 */
.dm-project-detail {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
}
.dm-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #f0f0f0;
}
.dm-detail-header h3 { font-size: 16px; font-weight: 700; }
.dm-detail-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
    padding: 8px 18px;
    border-bottom: 1px solid #f7f7f7;
    flex-wrap: wrap;
}
.dm-detail-section { padding: 14px 18px; border-bottom: 1px solid #f7f7f7; }
.dm-detail-section:last-child { border-bottom: none; }
.dm-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 10px;
}

/* 图纸列表 */
.dm-draw-list { border: 1px solid #f0f0f0; border-radius: 8px; overflow: hidden; }
.dm-group {}
.dm-group-label {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    border-bottom: 1px solid #f0f0f0;
}
.dm-draw-row {
    display: flex;
    align-items: center;
    padding: 7px 12px;
    border-bottom: 1px solid #f9f9f9;
    gap: 8px;
}
.dm-draw-row:last-child { border-bottom: none; }
.dm-draw-idx  { width: 20px; font-size: 11px; color: #ccc; text-align: right; flex-shrink: 0; }
.dm-draw-name { flex: 1; font-size: 13px; }
.dm-draw-layers { font-size: 11px; color: #aaa; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 分享 + 模型区域 */
.dm-share-area, .dm-model-area { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dm-share-link {
    font-size: 12px;
    color: #1a73e8;
    word-break: break-all;
    background: #e8f0fe;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    flex: 1;
}
.dm-share-link:hover { text-decoration: underline; }

/* 登录提示（短代码中） */
.dm-login-tip {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}
.dm-login-tip a { color: #1a73e8; }

@media (max-width: 600px) {
    .dm-field-row { flex-direction: column; }
    .dm-card-meta { font-size: 11px; }
    .dm-draw-layers { display: none; }
}
