*,*:before,*:after{margin:0;padding:0;box-sizing:border-box}:root{--bg: #fafafa;--surface: #f5f5f5;--border: #eaeaea;--text: #111;--text-secondary: #888;--radius: 14px;--shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);--shadow-lg: 0 4px 12px rgba(0, 0, 0, .08);--transition: .2s ease;--font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif}html{font-size:16px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{font-family:var(--font);background:var(--bg);color:var(--text);line-height:1.5;min-height:100dvh}button{font-family:var(--font);cursor:pointer;border:none;background:none;font-size:inherit}img{display:block;max-width:100%}.app{max-width:800px;margin:0 auto;padding:0 20px;display:flex;flex-direction:column;min-height:100dvh}.app-header{text-align:center;padding:28px 0 8px}.app-header h1{font-size:1.4rem;font-weight:600;letter-spacing:-.02em}.app-main{flex:1;display:flex;flex-direction:column;gap:20px;padding-bottom:24px}.ad-slot{width:100%;background:var(--surface);border:1px dashed var(--border);border-radius:var(--radius);display:flex;align-items:center;justify-content:center;color:var(--text-secondary);font-size:.8rem;letter-spacing:.04em;flex-shrink:0}.ad-slot--top{height:90px}.ad-slot--bottom{height:120px;margin-top:auto}.template-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.template-bar__status{font-size:.78rem;color:var(--text-secondary)}.corner-select{font-family:var(--font);font-size:.82rem;padding:5px 24px 5px 10px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;-moz-appearance:none;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center}.upload-zone{border:2px dashed var(--border);border-radius:var(--radius);padding:48px 24px;text-align:center;cursor:pointer;transition:border-color var(--transition),background var(--transition);background:#fff}.upload-zone:hover,.upload-zone.dragging{border-color:#ccc;background:var(--surface)}.upload-zone__icon{font-size:2rem;margin-bottom:12px;opacity:.5}.upload-zone__text{color:var(--text-secondary);font-size:.95rem}.editor{animation:fadeIn .3s ease}.editor__mode-toggle{display:flex;background:var(--surface);border-radius:10px;overflow:hidden;margin-bottom:12px;border:1px solid var(--border);width:fit-content}.editor__mode-toggle button{padding:6px 16px;font-size:.82rem;font-weight:500;color:var(--text-secondary);transition:background var(--transition),color var(--transition)}.editor__mode-toggle button.active{background:#fff;color:var(--text);box-shadow:var(--shadow)}.editor__toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px}.editor__toolbar label{font-size:.82rem;color:var(--text-secondary)}.editor__toolbar input[type=range]{width:100px;accent-color:#555}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:8px 18px;border-radius:10px;font-size:.88rem;font-weight:500;transition:opacity var(--transition),background var(--transition)}.btn:hover{opacity:.75}.btn--primary{background:var(--text);color:#fff}.btn--secondary{background:var(--surface);color:var(--text);border:1px solid var(--border)}.btn--small{padding:5px 12px;font-size:.8rem}.btn--icon{padding:4px;border-radius:50%;width:28px;height:28px;font-size:.9rem;background:var(--surface);border:1px solid var(--border)}.editor__canvas-wrapper{position:relative;background:#fff;border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}.editor__canvas-wrapper canvas{display:block;width:100%;height:auto;cursor:crosshair}.editor__close{position:absolute;top:8px;right:8px;z-index:2;background:#ffffffd9;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);border:1px solid var(--border);border-radius:50%;width:30px;height:30px;display:flex;align-items:center;justify-content:center;font-size:.85rem;transition:opacity var(--transition)}.editor__close:hover{opacity:.7}.editor__actions{display:flex;gap:10px;margin-top:14px;flex-wrap:wrap}.preview{animation:fadeIn .3s ease}.preview__toggle{display:flex;background:var(--surface);border-radius:10px;overflow:hidden;margin-bottom:12px;border:1px solid var(--border);width:fit-content}.preview__toggle button{padding:6px 16px;font-size:.82rem;font-weight:500;color:var(--text-secondary);transition:background var(--transition),color var(--transition)}.preview__toggle button.active{background:#fff;color:var(--text);box-shadow:var(--shadow)}.preview__image{border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;background:#fff}.preview__image img{width:100%;animation:fadeIn .3s ease}.history{animation:fadeIn .3s ease}.history__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.history__header h3{font-size:.85rem;font-weight:500;color:var(--text-secondary)}.history__grid{display:flex;gap:10px}.history__thumb{width:72px;height:72px;border-radius:10px;overflow:hidden;border:1px solid var(--border);cursor:pointer;transition:opacity var(--transition),box-shadow var(--transition);flex-shrink:0}.history__thumb:hover{box-shadow:var(--shadow-lg)}.history__thumb img{width:100%;height:100%;object-fit:cover}.spinner-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#ffffffb3;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);display:flex;align-items:center;justify-content:center;z-index:3;border-radius:var(--radius)}.spinner{width:28px;height:28px;border:3px solid var(--border);border-top-color:var(--text);border-radius:50%;animation:spin .7s linear infinite}@keyframes fadeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes spin{to{transform:rotate(360deg)}}@media(max-width:600px){.app{padding:0 14px}.app-header{padding:20px 0 4px}.app-header h1{font-size:1.2rem}.upload-zone{padding:36px 16px}.editor__toolbar{gap:8px}.editor__toolbar input[type=range]{width:80px}.history__thumb{width:60px;height:60px}}
